[thelist] PHP register_globals

Dave Stevens dave at stemfiction.com
Wed Jun 2 09:19:33 CDT 2004


Hi List,

I got started in PHP by using various tutorials around the web, and 
learnt that you could do:

   www.somesite.com/file.php?var1=something

and then set the response of the browser by doing:

   if ($var1) {

     do something to do with var1;

     } else {

     do something for the default state;

     }


However I've sinced found that with register_globals set to off, this 
won't work. Its not a major problem so far as my host has it on as 
default but I've heard plenty of reasons for setting it to off.

So what I'm wondering is how you make use of the query string

   www.somesite.com/file.php?var1=something

and reference it without the help of register_globals...

Googling this resulted in yet more reasons to turn off register_globals 
but nothing that told me how to work without it.

Thanks in advance
Dave


More information about the thelist mailing list