RE: [PHP-WIN] Problem with $GLOBALS
| From: | Jim George | Date: | Sun, 18 May 2003 07:26:09 +0000 |
| Subject: | RE: [PHP-WIN] Problem with $GLOBALS | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-19995@lists.php.net to get a copy of this message | ||
Jenifer,
thanks for that, worked beautifully.
Jim
-----Original Message-----
From: Jennifer S. [mailto:jennifer_p_s@yahoo.com.au]
Sent: 18 May 2003 05:43
To: Jim George; php-windows@lists.php.net
Subject: Re: [PHP-WIN] Problem with $GLOBALS
The book assumes that you have "register globals" set to "on" in your
php.ini file. By default it's off now. Change it to "on" and you should be
OK.
Cheers,
Jennifer
Jim George <jim.george@blueyonder.co.uk> wrote:
Folks,
I'm a total newbie with PHP and I've been working through "SAMS Teach
yourself PHP in 24 hours".
I got to Hour 9 where they introduced the concept of predefined
variables
and the $GLOBALS variable. Neither of these appear to work generating
all
sorts of errors.
Please find below a listing. Can someone help me please?
Thanks.
Jim
print "
Let's try that loop again
";
$user1="Harry";
$user2="Mary";
$user3="Bob";
foreach($GLOBALS as $key=>$value){
print "\$GLOBALS[\"$key\"] == $value";
}
?>
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
----------------------------------------------------------------------------
--
Yahoo! Mobile
- Check & compose your email via SMS on your Telstra or Vodafone mobile.