having trouble when the form action is the same page

When a form submits the data to the same page, what’s the best way of doing it?

ViewAndAddUsers.php
[php]

<?php if(!empty($_POST)) { //do a bunch of stuff } ?> //notice it's the same file! First name:
Last name: [/php]

The trouble is when a user refreshes the page the same POST is given. Is there a way to destroy the $_POST at the end of the script?

You see my question right?

<?php if(isset($_POST['firstname'])) { //do a bunch of stuff then echo"Insert Complete! "; } ?> //notice it's the same file! First name:
Last name:

Why does <meta http-equiv=refresh content=1;url=ViewAndAddUsers.php> work considering manually refreshing the page doesn’t work as desired?

when you add meta refresh it will take you to the page without any post data attached to it! when you use a form to bring you to the page it has post data attached to it! so just to make it nice and fresh clean page just refresh after post data!

Sponsor our Newsletter | Privacy Policy | Terms of Service