You are here: Re: [PHP] Refresh (F5) adds another SQL record. « PHP « IT news, forums, messages
Re: [PHP] Refresh (F5) adds another SQL record.

Posted by Marek Kilimajer on 10/21/48 11:16

Robert Meyer wrote:
> Hello,
>
> Scenario:
> 1) User is presented a blank form.
> 2) User fills in form.
> 3) User submits form.
> 4) Record is added to database.
> 5) Back to 1).

Go really back to 1) - use redirect. After the record is added to the
database, use something like:
header('Location: http://yourserver.com/form.php');
exit;

> All is fine to here.
> 6) User clicks refresh.
> 7) Another record is added, same data except auto-increment field.
> How do I prevent these last two steps, or at least prevent a record
> from being added when refresh is clicked?

You should see a message from your browser that data is being reposted.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация