|
Posted by s a n j a y on 07/17/06 00:59
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.
Navigation:
[Reply to this message]
|