You are here: Re: Duplicate records added from post forms, easy solutions? « PHP Programming Language « IT news, forums, messages
Re: Duplicate records added from post forms, easy solutions?

Posted by Juliette on 07/18/06 02:22

s a n j a y wrote:
> mindwarp wrote:
>> Hi,
>>
>> When a user submits / posts data my php script Inserts data into my
>> database.
>> If they refresh the script or click back and click submit again I get
>> duplicate record.
>>
>> Is there an easy solution to this?
>>
>> Or do I need to create a hidden field which contains some sort of
>> unquie data, like a time stamp and have a have a unique field which
>> stops it adding the record?
>>
>> Best regards,
>>
>> Jules.
>>
>
> I would go with what Jerry said. Set a session variable indicating that
> insertion has been done. If user tries to repost, check for existence of
> the variable and just escape all the insertion code.


I wouldn't advice that as that would also exclude a user from posting
*something else* using the same form.

 

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

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