I am trying to make a voting system but my query just doesnt work!
it always ads a vote, and it's not meant to count a vote when the user(ip) already voted the past 24 hours...
I need help quick!🙂
<?php
include('connect.php');
$ip = $_SERVER['REMOTE_ADDR'];
$query = "SELECT * FROM ip_vote WHERE ip='".$ip."' AND date BETWEEN NOW() AND (NOW() - INTERVAL 1 DAY)";
$result =mysql_query($query) or die(mysql_error());
if (mysql_num_rows($result) >= 1)
{
include('header.php');
echo '<div class="index_title"><h1>Oops! an error occured...</h1></div>';
googletitleads();
echo '<p style="font-size=1.6em; margin-left:15px;">you already voted the last 24 hours.</p>';
unset($_SESSION['side_id'],$_SESSION['type']);
include('footer.php');
}
?>