1

(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?

BlackM
  • 3,927
  • 8
  • 39
  • 69
Kittsil
  • 2,349
  • 13
  • 22
  • Can you show us the coding segment where the $_POST array is assigned its key=>value? It may help in answering this question. – Quentin Unknown Jun 10 '15 at 22:16
  • 5
    oh god you have register globals on - FLEEE: http://php.net/manual/en/faq.using.php#faq.register-globals –  Jun 10 '15 at 22:17
  • @Quentin I'm not setting it... it is a superglobal input to my php code. – Kittsil Jun 10 '15 at 22:18
  • As above, its register globals, which means you also have a pretty old php installation. You can turn it off in php.ini, but better to update to a newer php anyway (where it has been depreciated) – Steve Jun 10 '15 at 22:18
  • @Dagon That is definitely the setting. Thank you. My terrible sysadmin turned that on for no reason. If you submit an answer, I'll mark it as correct. – Kittsil Jun 10 '15 at 22:29

2 Answers2

3

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

1

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;

Community
  • 1
  • 1
Bizmate
  • 1,835
  • 1
  • 15
  • 19