Re: Newbie Book & Database Question

From: Date: Thu, 25 Apr 2002 14:00:42 +0000
Subject: Re: Newbie Book & Database Question
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-94559@lists.php.net to get a copy of this message
On Thursday, April 25, 2002, at 09:20 AM, David Garcia Aristegui wrote:
Try "PHP and MySQL Web Development", by Luke Welling and Laura Thompson; only one thing, maybe you'll have troubles with the form variables, put this code at the beginning of all book examples foreach (array_merge($_POST,$_GET) as $key=>$val) {
        global $$key;
        $$key=$val;
} Code made by Alok K. Dhir ;-)
The above is a creative way around using superglobals, but I recommend that you start learning PHP using them. An excellent, if somewhat easy, challenge will be to take any of the PHP books (every single one I've seen has used the deprecated register_globals=on method), use it to learn PHP, and simultaneously use the appropriate superglobal prefix for the variables. Thus, when the PHP book discusses making a GET method form or including vars on the querystring in a href attribute, make sure that in the "receiving" script you use $_GET['varname'] instead of $varname (as the book will no doubt use). Same for $_COOKIE, $_SERVER, $_SESSION, $_SERVER (read the man page for this one), and $_POST. Erik ---- Erik Price Web Developer Temp Media Lab, H.H. Brown pricee@hhbrown.com

« previous php.general (#94559) next »