I've searched for solutions on how prevent a browser refresh from posting a repeat process, and a suggestion of redirecting the page to a "dummy" page which then flips back to the main page seems like something I can handle.
My problem is, I'm not quite clear on the journey. Here's what I understand:
Page loads, waits for user input
User fills out form and hits "submit"
Page inits, with $_POST variable populated with form data (I have a db_start() up top)
PHP code is processed, at which point I take care of form data
here is where I'm not sure how the redirect should happen. I'm thinking:
Before page is released to browser, I redirect the page to the "dummy" page with something like this:
Finally, the dummy page has a single header command to reload, sans $_POST variable, the main page.PHP Code:
$host = $_SERVER['HTTP_HOST'];
$uri = rtrim(dirname($_SERVER['PHP_SELF']), '/\\');
$extra = 'dummy.php';
Do I have the right idea? Or is there a better way?