You are here: Re: Question on refresh « PHP Programming Language « IT news, forums, messages
Re: Question on refresh

Posted by Michael Fesser on 08/21/07 14:56

..oO(Shelly)

>Here is a problem I have come across a few times and wonder if there is a
>simple solution.
>
>On my form I have a submit button called, say, addEntry. I do a test for it
>as
>
>if (isset($_POST[addEntry'])) { code to insert stuff into the database }
>
>The problem is that after clicking the button, and the code returns it to
>the same screen, if the user clicks the refresh button on the browser it
>will add another entry. Is there a simple way to unset an html field test?

After processing the form, send a Location header (with absolute URL)
back to the browser to redirect him to the same page. Now when a user
hits refresh, the browser will just send a normal GET request, not a
POST again.

http://www.php.net/header

Micha

 

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

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