Click to See Complete Forum and Search --> : Bug on PHP4.3 + Apache2.0.4 + Win2000 Pro(SP2)


GreatKent2
09-15-2002, 01:52 PM
Hi,
I have just installed PHP4.3 with Apache2.0.4 on my Windows2000 Pro, it seems everything is alright. However, I now CANNOT pass variables among different PHP files! For Example:
http://mydomain.com/test.php?name=somebody
The problem is test.php cannot catch the variable -- name.
Could anybody please tell me what has been wrong?
Thanking you in advance.

dotwebbie
09-15-2002, 03:36 PM
The only thing I can tell you is that PHP is still buggy when it's used with Apache 2.x. :(

Do you mind giving the actual url? mydomain.com is a real site. They offer DNS, domain forwarding, etc.

GreatKent2
09-15-2002, 04:07 PM
Thank you for your reply.
Since PHP4 + Apache2 is still not yet stable, so I haven't put it into my server, thus I cannot give you the actually URL. I just test on localhost.

piersk
09-16-2002, 08:01 AM
How are you using the variable? Is it $name? Have you tried using $_GET[name]?

Praesius
09-16-2002, 10:36 AM
I had exactly the same problem as you: Apache 2.0.40 and PHP 4.2.3... thinking it was due to Apache 2.0, I downgraded it to 1.3.26 but I still have the problem!!! No way to pass variables in my browser...

maybe I'm doing something wrong but I really don't know what... please someone give me an idea!

thanks

dotwebbie
09-16-2002, 11:34 AM
Did you try the superglobals in PHP? How are you trying to get the var from teh browser?

GreatKent2
09-16-2002, 12:13 PM
Originally posted by Praesius
I had exactly the same problem as you: Apache 2.0.40 and PHP 4.2.3... thinking it was due to Apache 2.0, I downgraded it to 1.3.26 but I still have the problem!!! No way to pass variables in my browser...

maybe I'm doing something wrong but I really don't know what... please someone give me an idea!

thanks

I have also tried using Apache 1.3.26 with PHP4.3, but the problem persists.
Here is my test files:
------------------- test.htm -------------------------------------
<html><head>
<title>Test</title>
<head><body>

<form name="test" action="test.php" method="post">
<input type="text" name="name" >
<input type="submit" name="Submit" value="Submit">
</form>

</body></html>

------------------- test.php ------------------------------------
<html><head>
<title>PHP Test</title>
</head><body>

<?
if ($name) {echo "Yes!";}
else
{echo "No!";}
?>

</body>
</html>
-------------------------------------------------------------------------
The answer is always "No!". No matter whether I use "test.htm" or going directly to "test.php" by this url:
http://localhost/test.php?name=somebody

GreatKent2
09-16-2002, 12:22 PM
Originally posted by dotwebbie
Did you try the superglobals in PHP? How are you trying to get the var from teh browser?

Thank you very much! After I change the following in php.ini:

register_globals = Off
is changed to
register_globals = On

the problem is solved!

I wonder why this option is Off by default? Is there any drawbacks?

dotwebbie
09-16-2002, 12:25 PM
Okay, try this:

<?php
echo("$_GET[name]");
?>

and access it using http://you.com/test.php?name=Jack

dotwebbie
09-16-2002, 12:32 PM
Originally posted by GreatKent2


Thank you very much! After I change the following in php.ini:

register_globals = Off
is changed to
register_globals = On

the problem is solved!

I wonder why this option is Off by default? Is there any drawbacks?

To having it on? Yes, there is. Sorry, you must have posted while I was posting so I didn't see your post. :( register_globals are Off by default because of a security hole found in 4.0.6. So, php was rewritten to use the new superglobals.

GreatKent2
09-16-2002, 03:04 PM
oh i see, thank you really much :) :) :)

dotwebbie
09-16-2002, 03:10 PM
No problem. :)