eisdrache Posted May 9, 2006 Share Posted May 9, 2006 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. Quote Link to comment Share on other sites More sharing options...
ober Posted May 9, 2006 Share Posted May 9, 2006 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] Quote Link to comment Share on other sites More sharing options...
eisdrache Posted May 9, 2006 Author Share Posted May 9, 2006 great, thanks for the help.I can't believe how many times I actually looked at that article at php.net and still couldn't figure out the answer (my ADD must have been kickin in really bad).Anyway, thanks again. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.