Forum Moderators: coopster

Message Too Old, No Replies

Missing $_POST variables

PHP Server configuration problem?

         

s1dev

6:57 pm on Dec 13, 2004 (gmt 0)

10+ Year Member



Greetings,

I use $_POST variables to process forms. I just pushed some code to a client's server. Their server does not have $_POST,$_GET, etc variables defined. Only the old $HTTP_POST_VARS, $HTTP_GET_VARS, etc variables are present.
phptest.php shows they are running PHP Version 4.0.4pl1 on Linux with Apache.
Is there a configuration setting to 'turn on' these variables? Is their version of PHP too old?

Thanks in advance!

s1dev

7:22 pm on Dec 13, 2004 (gmt 0)

10+ Year Member



Update, from what I have been able to determine is that version of PHP is prior to the introduction of the superglobals. Am I correct?

Can someone suggest a technique to determine which array to use?

Thanks!

mincklerstraat

7:25 pm on Dec 13, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



This'd be a very, very old version of PHP, so it wouldn't have the $_POST variables, $_POST array kicks in at 4.1 and above. You'll need to auto-prepend a file that does:
$_POST = $HTTP_POST_VARS;
$_GET = $HTTP_GET_VARS;
and probably the same for $_SERVER, $_SESSION, and others if they're used. This is very, very old PHP; your client would do very well to find hosting or a server with newer PHP. Working on this sort of historic stuff is kinda like installing new plumbing on a shack that's going to tumble down in a few months anyways - your client will have to pay again to either have PHP5 configured to have these old arrays configged in (not such a big deal but why bother?) or to have you change the code again, more expensive in the long run.

s1dev

7:38 pm on Dec 13, 2004 (gmt 0)

10+ Year Member



Thanks for the info. It is an interesting scenario with this client. The developers are not allowed access to the site (other than to browse pages) So we are unable to determine what is going on. They just switched from a pure HTML site to add some form processing using PHP. I wouldn't have suspected such an old version being they installed it this year....

coopster

2:30 am on Dec 14, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld, s1dev.

That is an old version, indeed. You might also recommend the client update for security reasons alone.