I am using $_POST variables in some of my scripts, and sending the info to a database. However, if a user reloads the page, the data is sent again (resulting in repeat entries).
Is there any way to destroy $_POST variables after use? Using unset() does not work, since reloading the page will re-initialize $_POST variables. I need to destroy the variable entirely (ie: use $_POST['id'], then get rid of it so subsequent calls will not work).
clearing $_POST variables
Moderator: General Moderators
There must be but I just usually redirect them back to a certian page and make it go quick so they dont have a chance to do it. I never let it go more than 3 seconds. And alot of times only 1 second. However you could make a Thank you page and redirect all pages to that one with a 0 second delay as well.
- mydimension
- Moderator
- Posts: 531
- Joined: Tue Apr 23, 2002 6:00 pm
- Location: Lowell, MA USA
- Contact:
i covered this in another topic but i can't seem to find it. when the user refreshes the page, the browser re-submits the POST variables to the server. (most browsers issue a warning about this.) so there is now way to erase them. you should do what oldtimer does, redirect to another page after you process the POST data.