<? $radio = $_POST['radio'];

$ID = (int)$_POST['ID'];

$IP = $_SERVER['REMOTE_ADDR'];

include('concha.php');

$sql = "SELECT * FROM ip_encuestas WHERE encuesta = '$ID';";

$consulta = $conn->query($sql);
while ($row = $consulta->fetch_assoc())

{



$IP_e = $row["IP"];









}



$consulta->free_result();





if ($IP_e == '$IP') {echo "USTED YA VOTO"; exit;};





$encuesta = $_COOKIE["$ID"]; 



if ($encuesta == 1) {echo "USTED YA VOTO"; exit;};























$time = time();












































setcookie("$ID", 1, time() + (60 * 60 * 24 * 90));













include('concha.php');





$sql = "SELECT * FROM encuestas WHERE ID = '$ID'";



$consulta = $conn->query($sql);

while ($row = $consulta->fetch_assoc())

{

$ID = $row["ID"];

$t = $row["$radio"];

$t = $t + 1;









}

$consulta->free_result();





include 'concha.php';



$sSQL="UPDATE `$basedatos`.`encuestas` SET `$radio` =  '$t' WHERE `encuestas`.`ID` = $ID;";

$conn->query($sSQL);





?>





PROCESANDO...

<script>

location.href=('principal.php');

</script>

