Jump to content

clearing post data


lional

Recommended Posts

You can do a trick if its not the browser's Back button. If you have Back button <input type="submit" name="Back" value="Back"/> then on click of this you can redirect the user to location with some parameter passed like http;//previouspage url?btn=back and on the previous page you can put up the logic that if $_GET['btn'] is back then unset($_POST).

 

But if its a browser's back button then I believe its going to be tuff. but you can follow below link for your help

 

http://www.hunlock.com/blogs/Mastering_The_Back_Button_With_Javascript

Link to comment
https://forums.phpfreaks.com/topic/162343-clearing-post-data/#findComment-857115
Share on other sites

I have a script, but if a user uses the back button I want the post data to be cleared.

Is there a way to do this?

 

Any help will be appreciated

 

Yes, once the user posts the form and the data gets entered do a header redirect to a "thank you" page. This will clear the post data, so if they push back it will not re-submit the data.

Link to comment
https://forums.phpfreaks.com/topic/162343-clearing-post-data/#findComment-857127
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.