Re: Disabling Browser "BACK" button

From: Date: Thu, 01 Aug 2002 01:46:47 +0000
Subject: Re: Disabling Browser "BACK" button
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-110600@lists.php.net to get a copy of this message
on 01/08/02 3:42 AM, Petre (internet@vsa.co.za) wrote: > Well, OK, then, How do you design the app NOT to allow the form to POST > again when the user hits "BACK" The PHP script that process' the form submission shouldn't be an actual page that sends stuff to the browser. 1. form.php POSTs to parse.php 2. parse.php validates the submitted data, adds stuff to DBs, emails people, whatever, then does a header('Location: thanks.php') redirect (not outputting anything to the browser). if there's a an error in the data, it redirects back to form.php with an error message. 3. thanks.php says thanks for submitting the form When they hit "back" from thanks.php, they get the form again, and would have to click submit again to repost. When they click forward, they get the thankyou page. Since the script that adds stuff to the DB was never on the browser, it's impossible to refresh it and double-post. If you work on it, this can actually all be done within one php script, rather than 3. Good luck, Justin French

« previous php.general (#110600) next »