$_POST being automatically copied into other variables

85 views Asked by At

(I apologize for a stupid question. This must be a simple setting, but an hour of Google hasn't revealed it.)

We have a LAMP web server. When we send data through post, the $_POST variable is set as expected. But we also get a global variable for every entry in $_POST.

For instance, if $_POST['Research'] is "Yes", we also get a global $Research set to "Yes".

How do we turn this off?

2

There are 2 answers

0
AudioBubble On BEST ANSWER

you have the dangerous and deprecated

register globals on

basic details:

http://php.net/manual/en/faq.using.php#faq.register-globals

to turn off: http://php.net/manual/en/ini.core.php#ini.register-globals

if your php version is so old that it came with this on by default you should upgrade

0
Bizmate On

Your description sounds like you are using register globals?

If so I am surprised you are still able to as they are deprecated.

You should update your php or at least disable it in your php.ini conf - register_globals=0;