if ($http _cookie_vars["vote"]) {
echo "<script>alert (' You have already voted, please do not repeat the vote '); History.back ();</script>";
Exit
}
$vcount =$_post["Vcount"];
$lld =$_post["Jump"];
$tys =$_post["Tys"];
if (! $vcount) {
echo "<script>alert (' you have not selected any voting item '); History.back ();</script>";
Exit
}
$db = @mysql_connect ("localhost", "root", "root") or Die ("Database Tutorial Connection Failed");
mysql_select_db ("vote", $db);
if ($vcount && $lld) {
if ($tys = = "1") {
$sql = "Update vote set vcount=vcount+1 where id= $vcount";
$result =mysql_query ($sql, $db);
Setcookie ("vote", "vote", Time () +3600);
echo "<script>alert (' Vote for success! '); location.href= ' vote.php?id= $lld ';</script> ';
}
else {
for ($i =0; $i <sizeof ($vcount); $i + +) {
$sql 1= "Update vote set vcount=vcount+1 where id= $vcount [$i]";
$result 1=mysql_query ($sql 1, $db);
}
Setcookie ("vote", "vote", Time () +3600);
echo "<script>alert (' Vote for success! '); location.href= ' vote.php?id= $lld ';</script> ';
}
}