i am porting over PHP code that was running prior to PHP5.
Server is apache.
i cannot get _GET or _POST to return a value that normally be obtained from an HTML page. I do know that in this version of PHP, the $HTTP_GET_whatever function has been deprecated.
I am completely confused on this one. Any help would be appreciated.


9 Years
Discussion Span
Last Post by ubaldc

yes. thank you. even something as simple as echo "$_GET" does not work.
i know there are some changes in php5 but I am thinking this should work.
could it be in apache?

thanks again


It wouldn't really be Apache's fault so if you could post the code that's giving you the issue that would be awesome. Also, THANK YOU for leaving PHP4, it needs to die faster.


function parsegetpost($varname) {

// i have tried

global $_GET;
//and not declaring get at all.

but in essence, this is it

echo "get is $_GET["$varname"]";

// i have also tried

echo "get is $_GET";

// knowing that login is a variable in a html page

/// interestingly enough.. it is does not get upset when I do this..

if(isset($_GET["$varname"]) AND ($_GET["$varname"])) {
// nothing. put echo "$_GET" and it goes to hell



In PHP5 you don't have to declare the superglobals.
To see if you're getting anything in the request you can do:


This will print out anything in $_FILES , $_GET or $_POST


as with most software bugs, stupid overrules common sense.
using print_r, i discover that the variables were being POSTed.
that explains their lack of appearance at the right time. unfortunately, I inherited this code from someone long gone and have not looked at every module yet. I am fairly new to PHP, and without a doubt prefer the structured Java world but you go where the jobs are.
Again, I thank you for all your help.


This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.