Jump to content

PHP 4.0.4pl1 passing variables via url disabled?


eisdrache

Recommended Posts

I have been writing PHP5 for quite some time now without any problems. So, I know how to pass variables via url.

However, I recently began doing some work on an older server that is running PHP 4.0.4pl1 and it will not recogize any of my variables that I pass via the url.

Here is an example of some code that works perfectly on the server running PHP5 but does not work on the server running PHP 4.0.4pl1:

-------------
www.example.com/index.php?data=nodata

$data = "confused";

if ( $_GET['data'] ) {
if ( $_GET['data'] == "nodata" ) $data = "nodata";
else if ( $_GET['data'] == "all" ) $data = "all";
}

echo $data; // returns "confused"
-------------

Is this a known issue with PHP 4.0.4pl1 or is there something amiss in my php.ini file?

Thanks in advance for any help.
You can't use those global arrays until 4.1.

Before that you have to use $HTTP_GET_VARS['varname'], $HTTP_POST_VARS['varname'], etc.

EDIT: reference: [a href=\"http://us2.php.net/manual/nl/reserved.variables.php\" target=\"_blank\"]http://us2.php.net/manual/nl/reserved.variables.php[/a]

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.