Hi All,
Using POST values are obviously submitted to the PHP engine and processed by a script. When you refresh the browser immediately after a POST it asks you whether you want to resend the POST data.
Now, is there a way to "unset" the POST request after it has been sent?
Thanks.
unset $_POST
Moderator: General Moderators
- aceconcepts
- DevNet Resident
- Posts: 1424
- Joined: Mon Feb 06, 2006 11:26 am
- Location: London
Re: unset $_POST
It doesn't work unsetting the variable?
- aceconcepts
- DevNet Resident
- Posts: 1424
- Joined: Mon Feb 06, 2006 11:26 am
- Location: London
Re: unset $_POST
I'm talking about erasing the complete POST array.
However, I'm rather doubtful it can be done - after all it is a method.
However, I'm rather doubtful it can be done - after all it is a method.
Re: unset $_POST
The pattern I use most of the time is to redirect from the page that received the post request if it is successful (action completed). If you stay in the request (a redirect is a new request), there is no way to avoid resending the POST data on refresh.
Re: unset $_POST
Ok I see what you mean, sorry.
- aceconcepts
- DevNet Resident
- Posts: 1424
- Joined: Mon Feb 06, 2006 11:26 am
- Location: London
Re: unset $_POST
No worries Papa, i should have explained myself more clearly
Yes, I've had re-directs at the back of my mind. Was just wondering if there was an alternative.
Anyhow, thanks for the responses
Yes, I've had re-directs at the back of my mind. Was just wondering if there was an alternative.
Anyhow, thanks for the responses
Re: unset $_POST
Redirecting via header() eliminates the refresh warning.