Posted By

tylerhall on 09/21/07


Tagged

register globals


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

basicmagic
terriK


Undo Register Globals


 / Published in: PHP
 

Some shared hosting providers won't allow you to turn off register globals. This code undoes the effects of having the option turned on. You must run this code before any other code in your script.

  1. if(ini_get('register_globals'))
  2. {
  3. foreach(array_keys($_REQUEST) as $var)
  4. unset($$var);
  5. unset($var);
  6. }

Report this snippet  

You need to login to post a comment.