Jump to content

Recommended Posts

Let say I have 2 php file:

a.php : a form that let users to fill up.

b.php : where data are processed from a.php.

 

So after user fill up in a, the page will redirect to b. So my question is is there a way that prevent user to refresh/repost the form once they reach in b.php.

Because once users click the refresh button in the browser in b.php, the whole process will repeated with same data. Which is very bad.

 

Any idea? Thanks in advance.

Link to comment
https://forums.phpfreaks.com/topic/50315-solved-form-reposting/
Share on other sites

Could you do something like this? It eliminates a page and gives more control over the user "experience"

 

<?php

if(!$_POST['name_of_submit_button'])
{
   //Show Form Here
}
else
{
/* 
process form here and redirect to another page with all thank you's and such... that will make it so if the refresh button is hit, you are done with all the post data and it will simply refresh to the page you redirected to
*   

*/
}
?>

Link to comment
https://forums.phpfreaks.com/topic/50315-solved-form-reposting/#findComment-247006
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.