How to fix IP-Based voting?
<p>I have IP based voting code, but the problem is when I vote from my computer ( connected to the internet using the same network ) I can't !!  </p>

<p>Here is the code : </p>

<pre><code>global $wpdb;
$post_ID = $_POST['id'];
$ip = $_SERVER['REMOTE_ADDR'];
$irt_textOnclick = get_option('irt_textOnclick');
$recommend = get_post_meta($post_ID, '_recommended', true);

if($post_ID != '') {
    $voteStatusByIp = $wpdb-&gt;get_var("SELECT COUNT(*) FROM ".$wpdb-&gt;prefix."irecommendthis_votes WHERE post_id = '$post_ID' AND ip = '$ip'");

    if (!isset($_COOKIE['recommended-'.$post_ID]) &amp;&amp; $voteStatusByIp == 0) {
        $recommendNew = $recommend + 1;
        update_post_meta($post_ID, '_recommended', $recommendNew);

        setcookie('recommended-'.$post_ID, time(), time()+3600*24*365, '/');
        $wpdb-&gt;query("INSERT INTO ".$wpdb-&gt;prefix."irecommendthis_votes VALUES ('', NOW(), '$post_ID', '$ip')");

        $return_text = $recommendNew . ' ' . $irt_textOnclick;
        echo $return_text; //$recommendNew; // 
    }
    else {
        $return_text = $recommend . ' ' . $irt_textOnclick;
        echo $return_text; //$recommendNew; //  
    }
}
</code></pre>
