Re: Migration from register_globals=on to register_globals=off

From: Date: Wed, 04 Jun 2003 06:41:52 +0000
Subject: Re: Migration from register_globals=on to register_globals=off
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-150116@lists.php.net to get a copy of this message
If you're getting errors for undefined variables, you can reduce the level of error reporting in PHP.ini so it only does so for more serious errors. I had a similar problem and this cleared things up. See the PHP manual... http://www.php.net/manual/en/ref.errorfunc.php#ini.error-reporting Also, I don't recommend using the extract($_POST) command as a way around register_globals being off, it kind of defeats the purpose. Better to grab only those variables you need like this: $formvals = $_POST['my_formvals']; I put all form values into an array so I only have to grab one POST variable. It makes it a little easier. Also be sure to clean the data with some kind of function that uses strip_tags() and similar functions. Monty > From: ha@ematte.se (ØYstein HåLand) > Newsgroups: php.general > Date: Tue, 3 Jun 2003 18:44:30 +0200 > To: php-general@lists.php.net > Subject: Re: Migration from register_globals=on to register_globals=off > > I tried changing my code to (since the variable $printout in this case is > sent with GET) > ($_GET['printout'] != "yeah") { include("header.php"); } > and got the following error: > Undefined index: printout > >

« previous php.general (#150116) next »