php-windows Digest 30 Jan 2003 04:22:41 -0000 Issue 1562

Topics (messages 18172 through 18207):

Re: Is this possible
        18172 by: Vladimir Galkov

Re: Mail newbie Question
        18173 by: Vladimir Galkov

Counter problems!
        18174 by: Radovan Radic
        18175 by: J.Veenhuijsen
        18176 by: J.Veenhuijsen
        18178 by: Svensson, B.A.T. (HKG)
        18179 by: J.Veenhuijsen
        18183 by: Radovan Radic
        18190 by: cybot
        18192 by: cybot

Urgent Very Urgent
        18177 by: Vikas Pande
        18180 by: Asendorf, John
        18181 by: Svensson, B.A.T. (HKG)
        18182 by: Luis Ferro

PHP 4.3.0 - Occasionally outputting chunks of HTML to the page
        18184 by: Matt Babineau

Two errors, maybe related. phpMyAdmin refuses to run when dir is secure
        18185 by: Rod Martin
        18191 by: cybot
        18197 by: Rod Martin

Re: connection to ms sqlserver 7
        18186 by: phplam
        18189 by: Radovan Radic
        18195 by: Miha Nedok

Thank you for your help!!!
        18187 by: Sabina Alejandr Schneider

Re: displaying a numeral
        18188 by: cybot

Re: htpasswd question
        18193 by: metac0m

Passing Variables and Internal Variables
        18194 by: Wade
        18196 by: Dash McElroy

GD library for jpeg?
        18198 by: Afan Pasalic
        18199 by: Afan Pasalic
        18200 by: Chris Kranz
        18201 by: Chris Kranz
        18202 by: Afan Pasalic
        18205 by: Afan Pasalic
        18206 by: Christoph Grottolo

PHP on Windows.net Server
        18203 by: George Sas

.net
        18204 by: Nick H. -- Technical Support Engineer

Wierd Windows Problems
        18207 by: Chris Deam

Administrivia:

To subscribe to the digest, e-mail:
        [EMAIL PROTECTED]

To unsubscribe from the digest, e-mail:
        [EMAIL PROTECTED]

To post to the list, e-mail:
        [EMAIL PROTECTED]


----------------------------------------------------------------------
--- Begin Message ---
> You could allways call a javascript when you submit the form. the
javascript

or somth like that:

if (....)
 { $address = 'http://www.adress_one.ru'; }
else
 { $address = 'http://www.adress_one.ru'; }

<form action="<?print $address;?>">



--- End Message ---
--- Begin Message ---
check php.ini

[mail function]
; For Win32 only.
SMTP = you ISP's mail server (or your's).

after that restart webserver and use mail() function. You can check what
SMTP server use your php from phpinfo() function.

"Duncan" <[EMAIL PROTECTED]> ???????/???????? ? ???????? ?????????:
002c01c2c70d$620a0000$0100a8c0@syssrv">news:002c01c2c70d$620a0000$0100a8c0@syssrv...
> Hi All,
>
> Is it possible to create a page where visitors can for example submit
their
> email address and a list of their demands, then the page mails it to a
> support address?
>
> Would I have to use a mail server of any kind to send the emails?
>
> Where could I find an example script that could do this?
>
>
>
> Many thx in adv
>
>


--- End Message ---
--- Begin Message ---
Hi

I want to add simple counter on my index.php page.

counter.php:
<?
if (!session_is_registered("counter"))
{
  $fp=fopen("counter.txt","r");
  $counter=fread($fp);
  fclose($fp);
  $counter++;
  session_register("counter");
}
print "Visited: $counter<BR>";
?>

index.php
<?
session_start();
print "Simple page<BR>";
include("counter.php");
?>

This should work, but when someone refreshes index.php page, counter is
increased! How can i stop it?

Thx,
Radovan


--- End Message ---
--- Begin Message ---
You could check the IP adress of the visitor.
If it has not changed the the visitor is the same.
Last IP adress in the counter file?


Jochem

Radovan Radic wrote:
Hi

I want to add simple counter on my index.php page.

counter.php:
<?
if (!session_is_registered("counter"))
{
  $fp=fopen("counter.txt","r");
  $counter=fread($fp);
  fclose($fp);
  $counter++;
  session_register("counter");
}
print "Visited: $counter<BR>";
?>

index.php
<?
session_start();
print "Simple page<BR>";
include("counter.php");
?>

This should work, but when someone refreshes index.php page, counter is
increased! How can i stop it?

Thx,
Radovan



--- End Message ---
--- Begin Message ---
I use this on my site.

<script language="PHP">
$counter_file="./count.dat";
if (!($fp=fopen($counter_file,"r"))) die ("Cannot open $counter_file.");
$counter= (int) fread($fp,20);
fclose($fp);
if ($REMOTE_ADDR<>"000.000.000.000")
	{
	$counter++;
	$fp=fopen($counter_file,"w");
	fwrite($fp,$counter);
	fclose($fp);
	}
</script>


This filters my own visits to the site .

000.000.000.000 is of course my IP adress.

Jochem


Radovan Radic wrote:
Hi

I want to add simple counter on my index.php page.

counter.php:
<?
if (!session_is_registered("counter"))
{
  $fp=fopen("counter.txt","r");
  $counter=fread($fp);
  fclose($fp);
  $counter++;
  session_register("counter");
}
print "Visited: $counter<BR>";
?>

index.php
<?
session_start();
print "Simple page<BR>";
include("counter.php");
?>

This should work, but when someone refreshes index.php page, counter is
increased! How can i stop it?

Thx,
Radovan



--- End Message ---
--- Begin Message ---
There are some potential pitfalls involving:

CASE 1: Multi user systems:
You will see the same IP for all of the users on that system.

CASE 2: Firewalls
You might only see the firewalls IP# for each and every user behind it.

CASE 3: Dynamically assigned IP#
IP# might dynamically be assigned to different user at different times points



> -----Original Message-----
> From: J.Veenhuijsen [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, January 29, 2003 2:35 PM
> To: [EMAIL PROTECTED]
> Subject: [PHP-WIN] Re: Counter problems!
> 
> 
> You could check the IP adress of the visitor.
> If it has not changed the the visitor is the same.
> Last IP adress in the counter file?
> 
> 
> Jochem
> 
> Radovan Radic wrote:
> > Hi
> > 
> > I want to add simple counter on my index.php page.
> > 
> > counter.php:
> > <?
> > if (!session_is_registered("counter"))
> > {
> >   $fp=fopen("counter.txt","r");
> >   $counter=fread($fp);
> >   fclose($fp);
> >   $counter++;
> >   session_register("counter");
> > }
> > print "Visited: $counter<BR>";
> > ?>
> > 
> > index.php
> > <?
> > session_start();
> > print "Simple page<BR>";
> > include("counter.php");
> > ?>
> > 
> > This should work, but when someone refreshes index.php page, counter is
> > increased! How can i stop it?
> > 
> > Thx,
> > Radovan
> > 
> > 
> 
> 
> -- 
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
--- End Message ---
--- Begin Message ---
You've got a point there!!!!!!!!!!!

Jochem

B.A.T. Svensson wrote:
There are some potential pitfalls involving:

CASE 1: Multi user systems:
You will see the same IP for all of the users on that system.

CASE 2: Firewalls
You might only see the firewalls IP# for each and every user behind it.

CASE 3: Dynamically assigned IP#
IP# might dynamically be assigned to different user at different times points




-----Original Message-----
From: J.Veenhuijsen [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 29, 2003 2:35 PM
To: [EMAIL PROTECTED]
Subject: [PHP-WIN] Re: Counter problems!


You could check the IP adress of the visitor.
If it has not changed the the visitor is the same.
Last IP adress in the counter file?


Jochem

Radovan Radic wrote:

Hi

I want to add simple counter on my index.php page.

counter.php:
<?
if (!session_is_registered("counter"))
{
 $fp=fopen("counter.txt","r");
 $counter=fread($fp);
 fclose($fp);
 $counter++;
 session_register("counter");
}
print "Visited: $counter<BR>";
?>

index.php
<?
session_start();
print "Simple page<BR>";
include("counter.php");
?>

This should work, but when someone refreshes index.php page, counter is
increased! How can i stop it?

Thx,
Radovan



--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



--- End Message ---
--- Begin Message ---
So, is there some "perfect" counter? Or there is some simple solution?
I tried this (index.php)
<?
session_start();
if (!isset($QUERY_STRING))
  header("Location: index.php".SID);
else
{
  include("counter.php");
}
?>

This is helping when page is refreshed, but when someone types location in
the address bar:
http://mysite.com/index.php counter gets +1! Or this is normal behaviour?
Someone opened door again...

"J.Veenhuijsen" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> You've got a point there!!!!!!!!!!!
>
> Jochem
>
> B.A.T. Svensson wrote:
> > There are some potential pitfalls involving:
> >
> > CASE 1: Multi user systems:
> > You will see the same IP for all of the users on that system.
> >
> > CASE 2: Firewalls
> > You might only see the firewalls IP# for each and every user behind it.
> >
> > CASE 3: Dynamically assigned IP#
> > IP# might dynamically be assigned to different user at different times
points
> >
> >
> >
> >
> >>-----Original Message-----
> >>From: J.Veenhuijsen [mailto:[EMAIL PROTECTED]]
> >>Sent: Wednesday, January 29, 2003 2:35 PM
> >>To: [EMAIL PROTECTED]
> >>Subject: [PHP-WIN] Re: Counter problems!
> >>
> >>
> >>You could check the IP adress of the visitor.
> >>If it has not changed the the visitor is the same.
> >>Last IP adress in the counter file?
> >>
> >>
> >>Jochem
> >>
> >>Radovan Radic wrote:
> >>
> >>>Hi
> >>>
> >>>I want to add simple counter on my index.php page.
> >>>
> >>>counter.php:
> >>><?
> >>>if (!session_is_registered("counter"))
> >>>{
> >>>  $fp=fopen("counter.txt","r");
> >>>  $counter=fread($fp);
> >>>  fclose($fp);
> >>>  $counter++;
> >>>  session_register("counter");
> >>>}
> >>>print "Visited: $counter<BR>";
> >>>?>
> >>>
> >>>index.php
> >>><?
> >>>session_start();
> >>>print "Simple page<BR>";
> >>>include("counter.php");
> >>>?>
> >>>
> >>>This should work, but when someone refreshes index.php page, counter is
> >>>increased! How can i stop it?
> >>>
> >>>Thx,
> >>>Radovan
> >>>
> >>>
> >>
> >>
> >>--
> >>PHP Windows Mailing List (http://www.php.net/)
> >>To unsubscribe, visit: http://www.php.net/unsub.php
> >>
> >
>


--- End Message ---
--- Begin Message ---
use $_SESSION !

counter.php:
<?
if ( ! isset($_SESSION['count']) )
{
  $fp=fopen("counter.txt","r");
  $counter=fread($fp);
  fclose($fp);
  $counter++;
  $_SESSION['count'] = TRUE;
}
print "Visited: $counter<BR>";
?>

index.php
<?
session_start();
print "Simple page<BR>";
include("counter.php");
?>


Radovan Radic wrote:
Hi

I want to add simple counter on my index.php page.

counter.php:
<?
if (!session_is_registered("counter"))
{
  $fp=fopen("counter.txt","r");
  $counter=fread($fp);
  fclose($fp);
  $counter++;
  session_register("counter");
}
print "Visited: $counter<BR>";
?>

index.php
<?
session_start();
print "Simple page<BR>";
include("counter.php");
?>

This should work, but when someone refreshes index.php page, counter is
increased! How can i stop it?

Thx,
Radovan


--
Sebastian Mendel

[EMAIL PROTECTED]

www.sebastianmendel.de
www.tekkno4u.de
www.nofetish.com

--- End Message ---
--- Begin Message ---
CORRECT use $_SESSION !

counter.php:
<?
if ( ! isset($_SESSION['count']) )
{
  $fp=fopen("counter.txt","r");
  $_SESSION['count']=fread($fp);
  fclose($fp);
  $_SESSION['count']++;
}
print "Visited: $_SESSION['count']<BR>";
?>

index.php
<?
session_start();
print "Simple page<BR>";
include("counter.php");
?>


Radovan Radic wrote:

Hi

I want to add simple counter on my index.php page.

counter.php:
<?
if (!session_is_registered("counter"))
{
  $fp=fopen("counter.txt","r");
  $counter=fread($fp);
  fclose($fp);
  $counter++;
  session_register("counter");
}
print "Visited: $counter<BR>";
?>

index.php
<?
session_start();
print "Simple page<BR>";
include("counter.php");
?>

This should work, but when someone refreshes index.php page, counter is
increased! How can i stop it?

Thx,
Radovan



--
Sebastian Mendel

[EMAIL PROTECTED]

www.sebastianmendel.de
www.tekkno4u.de
www.nofetish.com

--- End Message ---
--- Begin Message ---
Hello,
 I am using the PHP - ISAPI patch on windows 2000
advanced server. I am stucked up somewhere which I
dont know while doing for sessions. Please mail me
your php.ini so that I can study it properly.
Thankx

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com
--- End Message ---
--- Begin Message ---
We'd love to help you but I don't think anyone is going to be sending you
their php.ini file so you can see all of their paths, permissions, installed
extensions, etc.

Please send us your PROBLEM and we'll see if we can help.

---------------------
John Asendorf - [EMAIL PROTECTED]
Web Applications Developer
http://www.lcounty.com - NEW FEATURES ADDED DAILY!
Licking County, Ohio, USA
740-349-3631
Nullum magnum ingenium sine mixtura dementiae fuit


> -----Original Message-----
> From: Vikas Pande [mailto:[EMAIL PROTECTED]]
> Sent: Wednesday, January 29, 2003 9:38 AM
> To: [EMAIL PROTECTED]
> Subject: [PHP-WIN] Urgent Very Urgent
> 
> 
> Hello,
>  I am using the PHP - ISAPI patch on windows 2000
> advanced server. I am stucked up somewhere which I
> dont know while doing for sessions. Please mail me
> your php.ini so that I can study it properly.
> Thankx
> 
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
> http://mailplus.yahoo.com
> 
> -- 
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
--- End Message ---
--- Begin Message ---
> Please send us your PROBLEM 

I really wished I could do *THAT*! (And never take it back again!! :)
--- End Message ---
--- Begin Message --- Somewhere in php.ini is a section regarding sessions. In it, it is stated that the default system temp directory is used by default... Do the IIS (i'm assuming you are running IIS) users have access (read and write) to that directory?

Cheers,
Luis Ferro
Teladigital.net

---
[This E-mail scanned for viruses by Declude Virus]

--- End Message ---
--- Begin Message ---
Anyone running 4.3.0 as a CGI see PHP occassionally output chunks of
HTML to the visible page? Refreshing usually gets rid of them, but its
very interesting to say the least....
 
Matt
--- End Message ---
--- Begin Message --- I'm running PHP4 on Windows 2000 on an IIS server connecting to a MySQL database (3.2.1 I believe).

I've just loaded phpMyAdmin and it runs fine. As strongly suggested by the docs, I need to protect the directory. Whenever I try to do that and I enter the userid and password, phpMyAdmin refuses to run with this error...

Fatal error: Failed opening required './libraries/grab_globals.lib.pp' (include_path='.;c:\php4\pear') in D:\path\to\phpmyadmin

It may be related, but when I run phpinfo, phpinfo runs just fine, but this is at the top of the result document., before the table....

Warning: Failed opening 'arttest.htm' for inclusion (include_path='.;c:\php4\pear') in D:\path\to\phpinfo.php on line 8

--- End Message ---
--- Begin Message --- i think the user under which your iis is running needs rights in this folders!

Rod Martin wrote:
I'm running PHP4 on Windows 2000 on an IIS server connecting to a MySQL database (3.2.1 I believe).

I've just loaded phpMyAdmin and it runs fine. As strongly suggested by the docs, I need to protect the directory. Whenever I try to do that and I enter the userid and password, phpMyAdmin refuses to run with this error...

Fatal error: Failed opening required './libraries/grab_globals.lib.pp' (include_path='.;c:\php4\pear') in D:\path\to\phpmyadmin

It may be related, but when I run phpinfo, phpinfo runs just fine, but this is at the top of the result document., before the table....

Warning: Failed opening 'arttest.htm' for inclusion (include_path='.;c:\php4\pear') in D:\path\to\phpinfo.php on line 8

--
Sebastian Mendel

[EMAIL PROTECTED]

www.sebastianmendel.de
www.tekkno4u.de
www.nofetish.com

--- End Message ---
--- Begin Message --- I think they do. We set up rights in the IIS software. There are several options on how to grant the rights, but only a few get us into the directory, and then phpMyAdmin doesn't run. What is the best way to set up the permissions in this case?

Rod

On Wednesday, January 29, 2003, at 12:58 PM, cybot wrote:

i think the user under which your iis is running needs rights in this folders!

Rod Martin wrote:
I'm running PHP4 on Windows 2000 on an IIS server connecting to a MySQL database (3.2.1 I believe).
I've just loaded phpMyAdmin and it runs fine. As strongly suggested by the docs, I need to protect the directory. Whenever I try to do that and I enter the userid and password, phpMyAdmin refuses to run with this error...
Fatal error: Failed opening required './libraries/grab_globals.lib.pp' (include_path='.;c:\php4\pear') in D:\path\to\phpmyadmin
It may be related, but when I run phpinfo, phpinfo runs just fine, but this is at the top of the result document., before the table....
Warning: Failed opening 'arttest.htm' for inclusion (include_path='.;c:\php4\pear') in D:\path\to\phpinfo.php on line 8
--
Sebastian Mendel

[EMAIL PROTECTED]

www.sebastianmendel.de
www.tekkno4u.de
www.nofetish.com


--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


--- End Message ---
--- Begin Message ---
Hi,
with adodb driver which is free download, seems to be easy. I'm now triying
with mysql, but I'll need it also with ms sqlserver 7
This driver covers a lot of databases with the same coding-like.  ms
sqlserver7 , oracle, access, mysql,...
See http://php.weblogs.com/adodb.

Good luck
phplam
"Ps Jkt" <[EMAIL PROTECTED]> escribió en el mensaje
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
>
>
> hi ...
>
> pls tell me how to connect ms sql server 7 ?
>
> thank
>
> fendy
>


--- End Message ---
--- Begin Message ---
Include php_mssql.dll extension
mssql_pconnect("dbhost","dbuser","dbpassword");
mssql_select_db("dbname");

This should work.

"Phplam" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi,
> with adodb driver which is free download, seems to be easy. I'm now
triying
> with mysql, but I'll need it also with ms sqlserver 7
> This driver covers a lot of databases with the same coding-like.  ms
> sqlserver7 , oracle, access, mysql,...
> See http://php.weblogs.com/adodb.
>
> Good luck
> phplam
> "Ps Jkt" <[EMAIL PROTECTED]> escribió en el mensaje
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> >
> >
> > hi ...
> >
> > pls tell me how to connect ms sql server 7 ?
> >
> > thank
> >
> > fendy
> >
>
>


--- End Message ---
--- Begin Message ---
And note thath you need the Client Connectivity components from the MSSQL
Server installation.

-Mike


On Wed, 29 Jan 2003, Radovan Radic wrote:

> Date: Wed, 29 Jan 2003 19:47:40 +0100
> From: Radovan Radic <[EMAIL PROTECTED]>
> To: [EMAIL PROTECTED]
> Subject: [PHP-WIN] Re: connection to ms sqlserver 7
>
> Include php_mssql.dll extension
> mssql_pconnect("dbhost","dbuser","dbpassword");
> mssql_select_db("dbname");
>
> This should work.
>
> "Phplam" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Hi,
> > with adodb driver which is free download, seems to be easy. I'm now
> triying
> > with mysql, but I'll need it also with ms sqlserver 7
> > This driver covers a lot of databases with the same coding-like.  ms
> > sqlserver7 , oracle, access, mysql,...
> > See http://php.weblogs.com/adodb.
> >
> > Good luck
> > phplam
> > "Ps Jkt" <[EMAIL PROTECTED]> escribió en el mensaje
> > [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > >
> > >
> > > hi ...
> > >
> > > pls tell me how to connect ms sql server 7 ?
> > >
> > > thank
> > >
> > > fendy
> > >
> >
> >
>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
--- End Message ---
--- Begin Message --- Hello to everybody!!! this time I'm writing to you to thank you all for the help you have iven to me this last days. I'm very satisffied with this language and with the group of persons that are working here. Thank you once more for your time and help! :-)

Sabina Alejandra Schneider
[EMAIL PROTECTED]






_________________________________________________________________

Tutopia - Acceso a Internet rápido, fácil y a los mejores precios.
http://www.tutopia.com
--- End Message ---
--- Begin Message ---
number_format()

Pat Johnston wrote:
Hi
I have a field in my MySQL database that's a decimal where I have figures of
millions without the decimal point -

i.e - 1500000

Is there a function in PHP to display this figure as a $ amount -

i.e - $1,500,000

I searched PHP manual without finding anything. If there is something in
the manual, can someone point me to it..

Regards, Pat


--
Sebastian Mendel

[EMAIL PROTECTED]

www.sebastianmendel.de
www.tekkno4u.de
www.nofetish.com

--- End Message ---
--- Begin Message ---
 
create an .htpasswd file like this:


C:\Apache\bin>htpasswd -c c:\.htpasswd USERNAME
Automatically using MD5 format.
New password: ******
Re-type new password: ******
Adding password for user USERNAME

If look in the .htpasswd you see that the pass is different thatn if you
use crypt or md5 to encrypt the same password.

--

SWAMP (Secure Windows Apache Mysql Php) is a fully configured,
installation of Apache (mod_ssl), PHP, MySQL, OpenSSL and related
administrative tools for Windows(TM) NT/2000/XP

http://swamp.sourceforge.net
http://sourceforge.net/projects/swamp/

"Dominik Wittenbeck" <[EMAIL PROTECTED]> wrote: 
> 
> I am currently trying to create a .htpasswd file for apache using PHP and
> the crypt() on Win2k. I can generate the file alright but it does not work.
> I have looked into some classes as well and all use the crypt() function.
> The reason for this not working is probably the algorithm used because the
> passwords within a .htpasswd created with apache looks a hell lot different
> using something like
> 
> $apr1$rB2.....$8iUWArWEsTQ2553kjk22NS1 (not a real password by the way)
> 
> anyone having experience with that? Something up because I use windows?
> 
> Dominik Wittenbeck
> ----------------------------------------------------------------
>   E-Mail:     [EMAIL PROTECTED]
>   URL:        http://www.developaz.com
> 
> 
> 
> -- 
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 
--- End Message ---
--- Begin Message ---
01292003 1540 CST

When I run this script I get the html at the end but no $result. If the
result is run on the same page as the output, there shouldnt be anything
variable wise stopping this from running, right?

Wade

<?php
    if (($_POST["val1"] == " ") || ($_POST["val2"] == " ") ||
($_POST["calc"] == " "))
    {
        header("Location: http://localhost/Learning PHP/PHP Fast &
Easy/Ch_6/calculate_form.html");
        exit;
    }

    if ($_POST["calc"] == "add")
    {
        $result = $val1 + $val2;
    }

        else if ($_POST["calc"] == "subtract")
        {
             $result = $val1 - $val2;
        }

        else if ($_POST["calc"] == "multiply")
        {
             $result = $val1 *  $val2;
        }

        else if ($_POST["calc"] == "divide")
        {
            $result = $val1 / $val2;
        }

?>

<html>
<head>
<title>Calculation Result</title>
<head>

<body>
    <p>The result of the calculation is: <?php "$result"; ?></p>
</body>
</html>

--- End Message ---
--- Begin Message ---
You are referencing the variables properly on the first if line, but then
you're calling $var1 and $var2 w/o using $_GET. Add that or do this:

$var1 = $_GET['var1'];
$var2 = $_GET['var2'];

You may also want to use !isset($varname) instead of checking to see if
the variables are equal to a space char (" ").

-Dash

"I have made mistakes but I have never made the mistake of claiming
that I have never made one."
                -- James Gordon Bennett

On Wed, 29 Jan 2003, Wade wrote:

> 01292003 1540 CST
>
> When I run this script I get the html at the end but no $result. If the
> result is run on the same page as the output, there shouldnt be anything
> variable wise stopping this from running, right?
>
> Wade
>
> <?php
>      if (($_POST["val1"] == " ") || ($_POST["val2"] == " ") ||
> ($_POST["calc"] == " "))
>      {
>          header("Location: http://localhost/Learning PHP/PHP Fast &
> Easy/Ch_6/calculate_form.html");
>          exit;
>      }
>
>      if ($_POST["calc"] == "add")
>      {
>          $result = $val1 + $val2;
>      }
>
>          else if ($_POST["calc"] == "subtract")
>          {
>               $result = $val1 - $val2;
>          }
>
>          else if ($_POST["calc"] == "multiply")
>          {
>               $result = $val1 *  $val2;
>          }
>
>          else if ($_POST["calc"] == "divide")
>          {
>              $result = $val1 / $val2;
>          }
>
> ?>
>
> <html>
> <head>
> <title>Calculation Result</title>
> <head>
>
> <body>
>      <p>The result of the calculation is: <?php "$result"; ?></p>
> </body>
> </html>
>
>
> --
> PHP Windows Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>

--- End Message ---
--- Begin Message ---
I tried an example from php.net site:

<?php
header ("Content-type: image/png");
$im = @imagecreate (50, 100)
    or die ("Cannot Initialize new GD image stream");
$background_color = imagecolorallocate ($im, 255, 255, 255);
$text_color = imagecolorallocate ($im, 233, 14, 91);
imagestring ($im, 1, 5, 5,  "A Simple Text String", $text_color);
imagepng ($im);
?>I'm getting some weird simbols/signs on screen (?PNG  
IHDR2dt&nPLTE???é['ËtL)But, when I try to use jpeg format - getting Fatal Error. 
Does it mean that my hosting company doesn't have instaled GD library that support 
jpeg?Thanks for any help.Afan
--- End Message ---
--- Begin Message ---
That would be strange - Explorer 6.0.
And hosting company is pair.com - pretty high ranked hosting co.

What could be the easiest way to check that, to be sure?

Afan



----- Original Message ----- 
From: Dash McElroy 
To: Afan Pasalic 
Sent: Wednesday, January 29, 2003 7:11 PM
Subject: Re: [PHP-WIN] GD library for jpeg?


It sounds as if your browser doesn't have support for PNG's, or you're
sending a wrong header... What browser version are you using?

Sounds like your hosting company doesn't have JPEG support built in. How
sad.

-Dash

"He's just a politician trying to save both his faces ..."

On Wed, 29 Jan 2003, Afan Pasalic wrote:

> I tried an example from php.net site:
>
> <?php
> header ("Content-type: image/png");
> $im = @imagecreate (50, 100)
>     or die ("Cannot Initialize new GD image stream"); $background_color
> = imagecolorallocate ($im, 255, 255, 255); $text_color =
> imagecolorallocate ($im, 233, 14, 91); imagestring ($im, 1, 5, 5, "A
> Simple Text String", $text_color); imagepng ($im); ?>I'm getting some
> weird simbols/signs on screen (?PNG  IHDR2dt&nPLTE???é['ËtL)But,
> when I try to use jpeg format - getting Fatal Error. Does it mean that
> my hosting company doesn't have instaled GD library that support
> jpeg?Thanks for any help.Afan
--- End Message ---
--- Begin Message ---
I could be wrong, but aren't some of the older versions of PHP without
JPEG gd lib ability?

I remember playing with the gd lib over a year ago, and I couldn't get
anything to come out as JPEG's. actually, there wasn't the functions to
do some of the stuff with JPEG's.

Maybe I was dreaming, but I seem to remember it clearly, that's why I
used NetPBM instead at the time...

chris kranz
fatcuban.com


-----Original Message-----
From: Afan Pasalic [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, January 30, 2003 12:19 AM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Fw: [PHP-WIN] GD library for jpeg?

That would be strange - Explorer 6.0.
And hosting company is pair.com - pretty high ranked hosting co.

What could be the easiest way to check that, to be sure?

Afan



----- Original Message ----- 
From: Dash McElroy 
To: Afan Pasalic 
Sent: Wednesday, January 29, 2003 7:11 PM
Subject: Re: [PHP-WIN] GD library for jpeg?


It sounds as if your browser doesn't have support for PNG's, or you're
sending a wrong header... What browser version are you using?

Sounds like your hosting company doesn't have JPEG support built in. How
sad.

-Dash

"He's just a politician trying to save both his faces ..."

On Wed, 29 Jan 2003, Afan Pasalic wrote:

> I tried an example from php.net site:
>
> <?php
> header ("Content-type: image/png");
> $im = @imagecreate (50, 100)
>     or die ("Cannot Initialize new GD image stream");
$background_color
> = imagecolorallocate ($im, 255, 255, 255); $text_color =
> imagecolorallocate ($im, 233, 14, 91); imagestring ($im, 1, 5, 5, "A
> Simple Text String", $text_color); imagepng ($im); ?>I'm getting some
> weird simbols/signs on screen (?PNG  IHDR2dt&nPLTE???é
['ËtL)But,
> when I try to use jpeg format - getting Fatal Error. Does it mean that
> my hosting company doesn't have instaled GD library that support
> jpeg?Thanks for any help.Afan

--- End Message ---
--- Begin Message ---
Sup:

http://gallery.menalto.com/modules.php?op=modload&name=GalleryFAQ&file=i
ndex&myfaq=yes&id_cat=3&categories=3+-+Gallery+Graphics+Toolkits&parent_
id=0

chris kranz
fatcuban.com


-----Original Message-----
From: Afan Pasalic [mailto:[EMAIL PROTECTED]] 
Sent: Thursday, January 30, 2003 12:19 AM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Fw: [PHP-WIN] GD library for jpeg?

That would be strange - Explorer 6.0.
And hosting company is pair.com - pretty high ranked hosting co.

What could be the easiest way to check that, to be sure?

Afan



----- Original Message ----- 
From: Dash McElroy 
To: Afan Pasalic 
Sent: Wednesday, January 29, 2003 7:11 PM
Subject: Re: [PHP-WIN] GD library for jpeg?


It sounds as if your browser doesn't have support for PNG's, or you're
sending a wrong header... What browser version are you using?

Sounds like your hosting company doesn't have JPEG support built in. How
sad.

-Dash

"He's just a politician trying to save both his faces ..."

On Wed, 29 Jan 2003, Afan Pasalic wrote:

> I tried an example from php.net site:
>
> <?php
> header ("Content-type: image/png");
> $im = @imagecreate (50, 100)
>     or die ("Cannot Initialize new GD image stream");
$background_color
> = imagecolorallocate ($im, 255, 255, 255); $text_color =
> imagecolorallocate ($im, 233, 14, 91); imagestring ($im, 1, 5, 5, "A
> Simple Text String", $text_color); imagepng ($im); ?>I'm getting some
> weird simbols/signs on screen (?PNG  IHDR2dt&nPLTE???é
['ËtL)But,
> when I try to use jpeg format - getting Fatal Error. Does it mean that
> my hosting company doesn't have instaled GD library that support
> jpeg?Thanks for any help.Afan

--- End Message ---
--- Begin Message ---
they have PHP 4 installed 


  ----- Original Message ----- 
  From: Chris Kranz 
  To: [EMAIL PROTECTED] 
  Sent: Wednesday, January 29, 2003 7:33 PM
  Subject: RE: [PHP-WIN] GD library for jpeg?


  I could be wrong, but aren't some of the older versions of PHP without
  JPEG gd lib ability?

  I remember playing with the gd lib over a year ago, and I couldn't get
  anything to come out as JPEG's. actually, there wasn't the functions to
  do some of the stuff with JPEG's.

  Maybe I was dreaming, but I seem to remember it clearly, that's why I
  used NetPBM instead at the time...

  chris kranz
  fatcuban.com


  -----Original Message-----
  From: Afan Pasalic [mailto:[EMAIL PROTECTED]] 
  Sent: Thursday, January 30, 2003 12:19 AM
  To: [EMAIL PROTECTED]
  Cc: [EMAIL PROTECTED]
  Subject: Fw: [PHP-WIN] GD library for jpeg?

  That would be strange - Explorer 6.0.
  And hosting company is pair.com - pretty high ranked hosting co.

  What could be the easiest way to check that, to be sure?

  Afan



  ----- Original Message ----- 
  From: Dash McElroy 
  To: Afan Pasalic 
  Sent: Wednesday, January 29, 2003 7:11 PM
  Subject: Re: [PHP-WIN] GD library for jpeg?


  It sounds as if your browser doesn't have support for PNG's, or you're
  sending a wrong header... What browser version are you using?

  Sounds like your hosting company doesn't have JPEG support built in. How
  sad.

  -Dash

  "He's just a politician trying to save both his faces ..."

  On Wed, 29 Jan 2003, Afan Pasalic wrote:

  > I tried an example from php.net site:
  >
  > <?php
  > header ("Content-type: image/png");
  > $im = @imagecreate (50, 100)
  >     or die ("Cannot Initialize new GD image stream");
  $background_color
  > = imagecolorallocate ($im, 255, 255, 255); $text_color =
  > imagecolorallocate ($im, 233, 14, 91); imagestring ($im, 1, 5, 5, "A
  > Simple Text String", $text_color); imagepng ($im); ?>I'm getting some
  > weird simbols/signs on screen (?PNG  IHDR2dt&nPLTE???é
  ['ËtL)But,
  > when I try to use jpeg format - getting Fatal Error. Does it mean that
  > my hosting company doesn't have instaled GD library that support
  > jpeg?Thanks for any help.Afan


  -- 
  PHP Windows Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
--- End Message ---
--- Begin Message ---
Actually, you're right. They don't host on Windows. But, isn't the same GD library 
used on both OS?

Afan

  ----- Original Message ----- 
  From: Christoph Grottolo 
  To: Afan Pasalic 
  Sent: Wednesday, January 29, 2003 7:40 PM
  Subject: Re: Fw: [PHP-WIN] GD library for jpeg?


  Hi

  [EMAIL PROTECTED] (Afan Pasalic) wrote in php.windows:

  >That would be strange - Explorer 6.0.

  Make sure you don't have any whitespace in your script before starting
  with "<?php" (no blank line, no space, no tab).

  >And hosting company is pair.com - pretty high ranked hosting co.

  I think pair.com don't host on windows, do they? Are you on the right
  group?

  >What could be the easiest way to check that, to be sure?

  Try with a working script, look at output of phpinfo();...
  Christoph

  >Afan
  >
  >
  >
  >----- Original Message ----- 
  >From: Dash McElroy 
  >To: Afan Pasalic 
  >Sent: Wednesday, January 29, 2003 7:11 PM
  >Subject: Re: [PHP-WIN] GD library for jpeg?
  >
  >
  >It sounds as if your browser doesn't have support for PNG's, or you're
  >sending a wrong header... What browser version are you using?
  >
  >Sounds like your hosting company doesn't have JPEG support built in. How
  >sad.
  >
  >-Dash
  >
  >"He's just a politician trying to save both his faces ..."
  >
  >On Wed, 29 Jan 2003, Afan Pasalic wrote:
  >
  >> I tried an example from php.net site:
  >>
  >> <?php
  >> header ("Content-type: image/png");
  >> $im = @imagecreate (50, 100)
  >>     or die ("Cannot Initialize new GD image stream"); $background_color
  >> = imagecolorallocate ($im, 255, 255, 255); $text_color =
  >> imagecolorallocate ($im, 233, 14, 91); imagestring ($im, 1, 5, 5, "A
  >> Simple Text String", $text_color); imagepng ($im); ?>I'm getting some
  >> weird simbols/signs on screen (?PNG  IHDR2d

  t&nPLTE???é['ËtL)But,
  >> when I try to use jpeg format - getting Fatal Error. Does it mean that
  >> my hosting company doesn't have instaled GD library that support
  >> jpeg?Thanks for any help.Afan
--- End Message ---
--- Begin Message ---
[EMAIL PROTECTED] (Afan Pasalic) wrote:

>Actually, you're right. They don't host on Windows. But, isn't the same GD library 
>used on both OS?
>
>Afan

Basically yes. But on Windows most people use precompiled versions
(same binaries) while it's quite common to compile oneself on other
OSs. Maybe you get a better answer on php-general.

Christoph
--- End Message ---
--- Begin Message ---
Hello news group.

I have been trying to install php on a Windows .Net Server and I keept
getting Error 400.

Here is the sollution.

After installing the PHP according to install.txt you have to go on the IIS
console and at:
Web Server Extenstions  ----- Add a new Web service extension.

Here you can add the "php" extension and the application used being
"php.exe".

I hope this will help also other people.

Best regards

George.


--- End Message ---
--- Begin Message ---
There was a resolution posted on this right about the time 4.3.0 came out
with a full kb article on how to fix.



Regards,
Nick H.
[EMAIL PROTECTED]


--- End Message ---
--- Begin Message ---
PLEASE HELP! I am frustrated.  Here is the scenario:

I am creating a demo disk consisting of MySQL,PHP,Apache to run on windows
98.  I already have my program running fine on Linux.
I copied over the php files and did the correct dos conversion on them.  I
had to make minor modifications to adjust for a windows environment (paths,
etc), but no major code changes.  Anyway, now many things are broken.  I am
listing these in the order of probably easiest to fix.

1. Duplicate rows coming back from SQL query, but query from console returns
correct number of rows.  Again, this works fine on the linux setup.

2. I have a submit button that looks like this:
<button type=submit name=action value=add>Add</Button>
And corresponding PHP is:
if ($action == "add"){
    do something;
}
This works fine in Netscape.  In IE, however, the $action variable is
getting set to "Add" and not "add" and hence the php test is failing.  Now I
know that it would be trivial to chanfe the php test to "Add", but again,
this exact code works fine on the Linux setup.

What could be so different about Apache/PHP/MySQL in a windows environment.
I am reluctant to post further code, but if you think it is necessary, I
will.

Thanks In Advance,
Chris Deam


--- End Message ---

Reply via email to