Размер файла: 651B
<?
include_once 'inc/db.php';
include_once 'inc/1.php';
if (!$user)header("Location: /aut.php");
$id=intval($_GET['id']);
$votes=intval($_GET['vote']);
$vo=mysql_query("SELECT * FROM `user_vote` WHERE `id` = '$id'");
$v=mysql_query("SELECT * FROM `user_votes` WHERE `vote` = '$id' AND `user` = '$user[id]'");
if (mysql_num_rows($vo)==0){
header("Location: /v2.php?id=$id");
exit;
}
if (mysql_result($v, 0)>0){
header("Location: /v2.php?id=$id");
exit;
}
mysql_query("INSERT INTO `user_votes` (`num`, `user`, `vote`) values ('$votes', '$user[id]', '$id')");
header("Location: /v2.php?id=$id");
include_once 'inc/foot.php';
?>