Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Refresh page does entry

Status
Not open for further replies.

Copierbw

Technical User
Sep 25, 2002
112
IE
I have a PHP page with a form a submit button and a few text boxes for entries. When I hit the submit button it does the correct entries as from the text fields into the MYSql database. It refresh the page onto itself and the text boxes appears to be empty, but if I hit the refresh browser button it does exactly the same entries into the DBase as if the text box entries are still there as variables.
 
Are you using POST or GET? When you refresh, are variables in the URL?
 
You should add the folowing line at the end of your database submitting code:

header( "Location: _THE_PAGE_WITH_YOUR_FORM_" );

In that case, refreshing will not cause submission;

P.S.

If there's HTML output somewhere in your form processing script, you should start caching the content at the begining with

ob_start();

and stop it anywhere after header() with

ob_end_flush()

HTH
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top