Re: Problem with $GLOBALS
| From: | Jennifer S. | Date: | Sun, 18 May 2003 04:42:58 +0000 |
| Subject: | Re: Problem with $GLOBALS | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-19993@lists.php.net to get a copy of this message | ||
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.