Problem running PHP on localhost

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View
I have installed Apache and PHP (and MySQL) on my own computer so that I can  
out my scripts without having to keep uploading them to my ISP.
I have created a very simple php script (below) just to test out my set-up.
This works fine when I upload it to the server at my ISP (when I type  
in the box, it is displayed back to me) but when I run it on my own system,
I get nothing. I can see the value in the querystring in the address bar of
my browser, but the $eek variable does not seem to be being set. Is there
something I need to enable in PHP or Apache to make this work?

echo $eek;
<INPUT name=eek>

Re: Problem running PHP on localhost

"Phil Preen" <n/a> wrote in message  
Quoted text here. Click to load it

Found it. I needed to set register_globals=on in php.ini  

Re: Problem running PHP on localhost

Phil Preen wrote:

Quoted text here. Click to load it

The requirement of register_globals being on is just a result of bad
programming practices, really. You should make an effort to use the
$_POST and $_GET arrays instead, based on the request method ("post" or
"get"). In a pinch, use the $_REQUEST array, but please note that this
also contains the elements from $_COOKIE as well (HTTP cookies).

As for server variables, use $_SERVER instead.

PHP manual: Using Register Globals:

Kim André Akerø
(remove NOSPAM to contact me directly)

Site Timeline