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=3send/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
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=3send/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
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 ?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit:
Bill [EMAIL PROTECTED] wrote:
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 ?
Because you get a new i from the URL, hence the GET
What
-Original Message-
From: Bill [mailto:[EMAIL PROTECTED]
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
The $_GET array comes from the URL which is resent every time someone
hits F5. unset works on the server, not on the browser. You could
capture it, add it to the session and then redirect without it in the URL.
Thank you,
Micah Gersten
onShore Networks
Internal Developer
http://www.onshore.com
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 ?
Are you saving the array to a database once it is created? If not, wouldn't
the array be
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
8 matches
Mail list logo