Jump to content

[SOLVED] Form reposting


xenophobia

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

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.