Re: converting scripts for register_globals=Off

From: Date: Thu, 29 Apr 2004 11:21:48 +0000
Subject: Re: converting scripts for register_globals=Off
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-34169@lists.php.net to get a copy of this message
From: "Kim Jacobs (Crooks) - Mweb" <KJacobs@mweb.com> > I have written some scripts to access my online > SQL db and I've tested the scripts on my machine > with PHP 4.3.6 and register_globals = On > Now where I host my site, uses PHP 4.3.5 and has > register_globals = Off which means of course, that > my scripts arent working, but I dont know why.... > > My question is, how do I convert my scripts so that they > will work please? I know that $id and $submit are two > of the 'inputs' that it doesnt like, but I dont know the rest If your program is well written, you can get away with just switching $id for $_REQUEST['id']. This is assuming you already properly validate and sanitize all of the data coming from the user. Using $_REQUEST['id'] doesn't make anything more or less secure, it's a matter of what you're doing with the data coming from the user. ---John Holmes...

« previous php.db (#34169) next »