put if (!isset($blocker)) { your form goes here within your form add print "<input type=hidden name=blocker value=1> end your form }
With this, your input form is on the page when the page first loads (and $blocker is not set), but disapears when the data is submitted and the page reloads. Even if the user hits the refresh button on the browser, the $blocker variable is still set and the form doesn't reapear. You can chain up a bunch of these and accomplish with one page what would have taken several. Hope this helps, Hugh ----- Original Message ----- From: "Lars Espelid" <[EMAIL PROTECTED]> To: <[EMAIL PROTECTED]> Sent: Tuesday, December 03, 2002 3:17 PM Subject: [PHP] Prevent storing data when reload > Hello, > > I have a php-page whith a form-schema which stores data to a mysql-database > on submit. (The schema posts data to the same page (php-self).) > > When I reload the page the data gets stored once more. I'm sure this is a > well known problem. Are there any smart tricks to prevent this from > happening? > > Thanks! > > Lars > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php