Re: Variables that persist through reload?
| From: | David Chamberlin | Date: | Fri, 03 Jan 2003 20:21:57 +0000 |
| Subject: | Re: Variables that persist through reload? | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-130151@lists.php.net to get a copy of this message | ||
Ahhh.....that explains it. Just read up on register_globals. I understand now.
To make the script work with register_globals off I can just do:
$pick = $_GET['pick'];
And then the rest works. Thanks!
-Dave
Joseph W. Goff wrote:
Your local version does not have register_globals turned on in php.ini. You can either set the value = on or access posted values by using $_POST or $HTTP_POST_VARS depending on your version of php. ----- Original Message ----- From: "David Chamberlin" <dwc@nautiboy.com> To: <php-general@lists.php.net> Sent: Friday, January 03, 2003 1:58 PM Subject: [PHP] Variables that persist through reload?Hey, I'm somewhat new to PHP and I'm doing a lot of forms stuff. Looking at some of the examples at: http://www.linuxguruz.org/z.php?id=33 The variables seem to persist through a reload. For example, the first demo has: ---- <? if (!isset($pick)) { echo "Fill out and submit the form below."; } else { $j = count($pick); for($i=0; $i<$j; $i++) { echo "Pick <b>$pick[$i]</b> is Checked<br />"; } } ?> <form action="<? echo $PHP_SELF; ?>"> <ol> <li>Painting<input name="pick[]" type=checkbox value="Painting" /></li> <li>Plumbing<input name="pick[]" type=checkbox value="Plumbing" /></li> <li>Electric<input name="pick[]" type=checkbox value="Electric" /></li> </ol> <input type="submit" value="Submit!" /> <input type="reset" value="Reset" /> </form> -------- So the $pick variable is maitained through the submit. When I demo the script on that site, it works as advertised. When I use the same code on my web server, it doesn't work ($pick is never set after submitting). Is there some configuration option that dictates whether variables persist in this manner? Thanks, Dave -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php