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

Reply via email to