Jump to content

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]
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.