RE: [PHP] unset($_GET['i'])
| From: | Boyd, Todd M. | Date: | Thu, 04 Sep 2008 20:28:31 +0000 |
| Subject: | RE: [PHP] unset($_GET['i']) | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-279527@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: Bill [mailto:billlab51@hotmail.com]
> Sent: Thursday, September 04, 2008 3:23 PM
> To: php-general@lists.php.net
> Subject: Re: [PHP] unset($_GET['i'])
>
> Dan Shirah a écrit :
> > How about just adding a simple counter on your page.
> >
>
> That's what I do but that "counter" resets when you press F5 and is not
> functionnal.
>
> Why $_GET['i'] doesn't unsets ?
Your page URL has ?i=asdf in it. As such, $_GET['i'] is being set every time you refresh
that particular URL. Unsetting $_GET['i'] will only erase the variable for that instance
of that PHP script. As soon as you refresh, you are calling a new instance of that PHP script and
assigning $_GET['i'] the value "asdf" (or whatever).
If clearing that value on refresh is truly important to you, then don't use GET.
Todd Boyd
Web Programmer