Jump to content

Recommended Posts

Any ideas?

 

Yes, php.net put in some brilliant lazy-way short-cuts in the early versions of php that proved brilliant (several provided security holes that hackers can use) and they have just about all been turned off by default, the setting that is likely causing your problem was turned off 9 years ago, so that they can eventually be removed from the language. However, a lot of web hosting and php programmers never updated their settings and code to match the recommendations from php.net.

 

Your code likely thinks that program variables, i.e $var, will magically get set from the actual $_GET, $_POST, $_COOKIE, $_FILES, $_SESSION, $_SERVER, and $_ENV variable where the data is at. You need to either add code to set your program variables from the correct $_GET, $_POST, $_COOKIE, $_FILES, $_SESSION, $_SERVER, and $_ENV variables where the data is coming from or you need to use the actual $_GET, $_POST, $_COOKIE, $_FILES, $_SESSION, $_SERVER, and $_ENV variables in your code.

 

If your form is using the POST method, your form data will be available in $_POST variables. In the case of your GET parameters on the end of the URLs, the data will be available in $_GET variables.

Link to comment
https://forums.phpfreaks.com/topic/235846-php-form/#findComment-1212345
Share on other sites

It's a safe bet that your code was not written over 9 years ago. Whoever wrote it should have been aware of this problem and should not have written code dependent on the setting.

 

The reason I didn't mention the setting name is so you wouldn't be tempted to turn it on, since it is going to be removed in the next major php version release (should that ever occur.) You must eventually fix your code. Why not do that now so that your code will work on any server?

 

For a link like page.php?mode=script, you would use $_GET['mode'] in your code to reference the value.

 

$mode = $_GET['mode']; // set the program variable $mode from the GET parameter on the end of the url

 

 

Link to comment
https://forums.phpfreaks.com/topic/235846-php-form/#findComment-1212355
Share on other sites

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.