Hello, i need help on writing a code that can stop a person from voting twice. such as by refreshing the page, clicking back, or clicking on the button again.
can anyone help?
thanks
heres my voting code so far, it works but user can double vote.
<?php
$con= mysql_connect("xxxxx","xxxxx","xxxxx");
mysql_select_db("xxxxxx",$con);
// my get vars from links
$id = $_GET['id'];
$rating= $_GET['rating'];
if($rating= 1 && $rating!=2)
{
$enterrating = "UPDATE xxxx SET dislike=dislike +1 WHERE ID = \"$id\" ";
mysql_query($enterrating);
}
if($rating=2 && $rating!=1)
{
$enterratings = "UPDATE xxxx SET like=like +1 WHERE ID = \"$id\" ";
mysql_query($enterratings);
} // show poll
}
mysql_close($con);