File: /var/www/likoholding/old.liko-holding.com.ua/jscripts/ajax/addvote.php
<?
include_once $_SERVER['DOCUMENT_ROOT']."/system.fns.php";
$conn = db_connect();
if(isset($_GET['poll_id'])){
$test = "where ip = '".$_SERVER['REMOTE_ADDR']."' and poll_id = ".$_GET['poll_id'];
if(check_in_db(VOTED_IP, $test)){
}else{
$idx = "r".$_GET['poll_id'];
$sql = "update ".MVOTES." set votes = votes+1 where id = '$_GET[$idx]'";
$result = mysql_query($sql, $conn);
$sql = "insert into ".VOTED_IP."
(poll_id, ip)
values
('$_GET[poll_id]', '$_SERVER[REMOTE_ADDR]')";
$result = mysql_query($sql, $conn);
include_once "golosovanie.php";
}
}
?>