You are here: Re: How to prevent resending of $_POST data « All PHP « IT news, forums, messages
Re: How to prevent resending of $_POST data

Posted by J.O. Aho on 09/28/25 11:42

rcross@gmail.com wrote:

> If anyone refreshes the page AFTER data has been submitted, a duplicate
> entry is created in the database. I believe that the problem is in the
> $_POST['submit'] object itself.

Due "HTTP" standards data is resent on refresh and has nothing with how PHP works.


> I know I'm not doing anything
> incorrect regarding normal field submission, so maybe it's just in the
> way I'm asking PHP handle the POST data? Is there a trick to have the
> script not re-submit the data if the data was already submitted once?

You can create a temporary cookie that you use to check if the data has
already been processed once. You can make so the "form page" removes the
cookie, and in this way eliminate the risk that new data is denied.


//Aho

 

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

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