Globals question
| From: | Ryan A | Date: | Fri, 02 May 2003 17:59:17 +0000 |
| Subject: | Globals question | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-146165@lists.php.net to get a copy of this message | ||
Hi, (Warning, kind of newbie alert)
I have created a script which will take a lot of values from a form
I am getting various values entered into the script from variables like
$customer_name, $product_id etc etc I just take and use those variables as
is
eg:
I _DONT_ do:
$customer_name== $_GET['page'];
BUT my friend tells me that I should do that as "register globals" are off
on a lot of servers....which is getting me quite confused.
Should I convert all my scripts so it will work with register globals off?
Then for "GET" I use $_GET and for "POST" I am guessing I will have to use
$_POST, or should I use $_REQUEST?
or (my favourite alternative) is just keep the code as is and if they dont
have register globals on...tough luck! :-)
What do you think?
Because just thinking of going through all those damn variables one by one
and converting them sure sounds like a pain in the....exactly what you
thought :-)
After going on google and searching for the answer I see that even the
creator or PHP thinks that register globals should be on as putting it off
does not add to a higher sense of
security.(http://www.webmasterbase.com/article/767/)
Any advise/suggestions/comments welcome.
Cheers,
-Ryan