Re: variables??

From: Date: Thu, 27 Mar 2003 16:15:41 +0000
Subject: Re: variables??
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-141249@lists.php.net to get a copy of this message
Rick, use explode to insert the array in the symbole table, then every get / post (depend wich you explode) variable is available. Alex "John W. Holmes" <holmes072000@charter.net> schrieb im Newsbeitrag news:004501c2f33c$42d751f0$7c02a8c0@coconut... Okay, true. But they key here is the "act accordingly", meaning you sanitize and validate the variable before using it anywhere. Sometimes the way it's represented is that just using $_GET['var'] is going to make things more secure than using $var, which is not the case unless you know what exactly $_GET['var'] contains and how you're using it. ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ -----Original Message----- From: Leif K-Brooks [mailto:eurleif@buyer-brokerage.com] Sent: Tuesday, March 25, 2003 8:15 PM To: holmes072000@charter.net Cc: php-general@lists.php.net Subject: Re: [PHP] variables?? No, it is more secure. The problem with register_globals is that ALL variables become global - not just the ones you want to be. Example: if(something) $authorized = true; if($authorized){ ...do something requiring security... } A hacker could easily go to script.php?authorized=1, and gain access. If you only allow one variable in that ($_GET['var']), you will know that the variable is from an outside source, and can act accordingly. John W. Holmes wrote: It is considered more secure to declare the variable explicitly. $var = $_GET["var"]; Ummm... that's the same result as having register_globals on (basically). You're not helping anything and it's certainly not any more "secure". ---John W. Holmes... PHP Architect - A monthly magazine for PHP Professionals. Get your copy today. http://www.phparch.com/ I'm having a problem with form data being recognized by a php script. If I send information with a GET the variable data appears in $GET[var] but not $var. > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php -- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law.

« previous php.general (#141249) next »