File: /var/www/likoholding/old.liko-holding.com.ua/modules/polls/addvote.php
<?
$conn = db_connect();
$test = "where ip = '".$_SERVER['REMOTE_ADDR']."' and poll_id = $_POST[poll_id]";
if(check_in_db(VOTED_IP, $test))
redirect($_SESSION['goback']);
else
{
$idx = "r".$_POST['poll_id'];
$sql = "update ".MVOTES." set votes = votes+1 where id = '$_POST[$idx]'";
$result = mysql_query($sql, $conn);
$sql = "insert into ".VOTED_IP."
(poll_id, ip)
values
('$_POST[poll_id]', '$_SERVER[REMOTE_ADDR]')";
$result = mysql_query($sql, $conn);
redirect($_POST['goback']);
}
?>