I generate random key and put it on the hidden input. When I get submit from
client, I compare, is this key actual or old.

<?php
session_start();
session_register('key');

if ($user_key == $key){
 echo "Normal submit<br>";
}else{
 echo "Refresh";
}

mt_srand((double)microtime()*1000000);
$key = md5(mt_rand(0,9999999));

$html  = "<FORM action=\"test.php\" method=\"post\">\n".
   "<INPUT type=\"text\" name=\"text\" /><br>\n".
   "<INPUT type=\"submit\" />\n".
   "<INPUT type=\"hidden\" name=\"user_key\" value=\"$key\" />\n".
   "</FORM>\n";
echo $html;
?>

Raivo Tali

"Ryan Adorable" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi,
>
>    I created a poll program for my homepage. When i vote some field in my
database gets incremented, but after successfully voting when i clicked on
reload/refresh of my browser the said field is also incremented. How can I
fix/avoid this problem?
>
>    Hoping for a reply.
>    Thanks
>
> Ryan
>
> _____________________________________________________________
> Sign up for FREE email from FloppyDisk at http://www.floppydiskonline.com



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to