Re: unset($_GET['i'])
| From: | Dan Shirah | Date: | Thu, 04 Sep 2008 19:55:51 +0000 |
| Subject: | Re: unset($_GET['i']) | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-279522@lists.php.net to get a copy of this message | ||
>
> Hi
>
> given page1 has a list of goods and sends $i as a variable into a link to
> page2, ie, <a href="page2.php?i=3">send</a>
>
> Page2 adds the items recieved in an array.
>
> In page2 how can I unset the $_GET['i'] so that if I press F5(refresh) it
> doesn't add the same item to the array ?
>
> I tried unset($_GET['i']) but no success.
>
> Thanks
How about just adding a simple counter on your page.
if ($count == "0") {
Run through your script
At the end update the variable: $count == "1";
} else {
Don't run throught script because the value has already been added
}