Hi,
I am having some problems with duplicate form input.
I have a form that adds comments to an article, works fine, but if the user clicks on "refresh", having added a comment previously, the same comment is added again. I tried clearing the variables after the database write, but the refresh somehow resends the previous values.
Roughly, heres how my script works: (not using actual code syntax here)
------------------
if {$flag=1 AND $name!='' AND $commentbody!=''){
inserts the comment into the database
$flag = 0
$name = ''
$comment = ''
}
------------------
routine to display the article and the existing comments here
------------------
form here
if user clicks send, puts $flag=1 and calls same page
------------------
How can i prevent these double entries? Some command to definitely clear the variables?
Thanks.
Pag
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
- Re: [PHP] how could a php script return... Hatem Ben
- Re: [PHP] how could a php script re... Michael J. Pawlowsky
- [PHP] RE : [PHP] how could a php sc... Hatem Ben
- Re: [PHP] how could a php script re... John Nichel
- Re: [PHP] how could a php script re... Hatem Ben
- Re: [PHP] how could a php script return a dns er... Hatem Ben
- Re: [PHP] how could a php script return a d... Sean Burlington
- Re: [PHP] how could a php script return... Michael J. Pawlowsky
- Re: [PHP] how could a php script re... Hatem Ben
- Re: [PHP] how could a php script re... Michael J. Pawlowsky
- Re: [PHP] Form duplicate post probl... Pag
- Re: [PHP] Form duplicate post probl... Timothy Hitchens (HiTCHO)
- Re: [PHP] Form duplicate post probl... Pag
- RE: [PHP] Form duplicate post probl... John W. Holmes
- RE: [PHP] Form duplicate post probl... Pag
- RE: [PHP] Form duplicate post probl... John W. Holmes
- RE: [PHP] Form duplicate post probl... Pag
- Re: [PHP] Form duplicate post probl... Jason Wong
- Re: [PHP] Form duplicate post probl... Pag
- Re: [PHP] Form duplicate post probl... Jason Wong
- RE: [PHP] Form duplicate post probl... John W. Holmes