The best way to do this is with an HTTP header called Location.

It is used like this. If page1.php contains a form that submits to 
page2.php, you will want to handle the form data with page2.php, and 
when you're finished, have a line that looks like this:


In this example page3.php would be what you want the user to see, so any 
output that is in page2.php should be moved to here. When the user 
refreshes the page, only page3.php will be executed. If the user clicks 
back once, page1.php is displayed (the form). So, the intermediate 
"processing" page is transparent.

Chris wrote:

>Hello group,
>I need a good solution to prevent sending form data to server after hiting
>refresh. How can PHP know  that user hit refresh and sent data that already
>have been  stored in database (without querying database)?

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to