Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.