Click to See Complete Forum and Search --> : passing variables not working php4-4.2.1


Anon
08-05-2002, 05:22 AM
I have just installed apache-1.3.26 and php4-4.2.1 on a freeBSD 4.6 box. The web server and php pages all work fine, except when passing variables to another page in the URL. eg. the following code will not work:

<?
$counter=$counter+1;
echo \"$counter\";
echo \"<p><a href=\\\"$PHP_SELF?counter=$counter\\\">increase</a>\";
?>

The code works on another box that I setup exactly the same, the only difference is that it is running php4-4.1.1

Thanks

Clint

nostradamus
08-05-2002, 05:32 AM
set register_globals in php.ini to on.

Anon
08-05-2002, 05:37 AM
php is being used as an apache module, how do I set the config settings in the apache config files?:

http://www.phpbuilder.com/manual/configuration.php#configuration.file

Anon
08-05-2002, 06:01 AM
Kewl, thanks Nostr@damus that got it working.

And for others that may have a similar problem and find this:

Firstly, use phpinfo() to find where your php.ini file is stored. You will find a file called php.ini-dist, copy that over to php.ini and make your alterations to that file. When done, restart the server and all should be well.

btw, setting register_globals to 'on' is considered a security hazzard.. $HTTP_*_VARS[] should be used instead of passing variables in the URL... better start re-writting that code :/

Clint