PHP check if a value says true, if yes do this - doesn't work
<p>I have a simple vote system that generates a shuffled code after you have voted.
I have a little callback system that checks if the user voted on the site.</p>

<p>Looks like this:</p>

<p><a href="http://gamingtoplist.net/?hasvoted=187&amp;ip=82.81.33.168" rel="nofollow">http://gamingtoplist.net/?hasvoted=187&amp;ip=82.81.33.168</a></p>

<p>187 = server ID on top list
IP = The ip that has just voted.</p>

<p>If it says true when you go to this page, that means that IP has voted for that server ID.
If it says false, that means the IP hasn't voted for the server ID.</p>

<p>I have just voted, as you see it says true.</p>

<p>Now to check if voted I do this:</p>

<pre><code>if (isset($_POST['submit'])) {
    $check_GTL = file_get_contents("http://gamingtoplist.net/?hasvoted=187&amp;ip=".$_SERVER['REMOTE_ADDR']);
        if ($check_GTL != "true") {
                $errors[] = "Sorry, but it seems like you haven't voted on all links, please contact Jony.";
        }
</code></pre>

<p>That line checks if you have voted:</p>

<pre><code>$check_GTL = file_get_contents("http://gamingtoplist.net/?hasvoted=187&amp;ip=".$_SERVER['REMOTE_ADDR']);
</code></pre>

<p>But for some random reason, the script tells me that check_GTL is not 'true'.
Yet it is true....</p>

<p>What is wrong with it?</p>

<p>Thanks!</p>

<p>All of it:</p>

<pre><code>if (isset($_POST['submit'])) {
    $check_GTL = file_get_contents("http://gamingtoplist.net/?hasvoted=187&amp;ip=".$_SERVER['REMOTE_ADDR']);
        if ($check_GTL != "true") {
                $errors[] = "Sorry, but it seems like you haven't voted on all links, please contact Jony.";
        }


if($check_GTL == "true") { // if($votes &gt; 0 &amp;&amp; $check_GTL == "true") { disab led $votes cause runelocus didnt work lately for some reason.

        $insert = "INSERT INTO votes(auth, ip, received, time) VALUES('".$auth."', '".$_SERVER['REMOTE_ADDR']."', '0', '".time()."')";
        $insert = $connect-&gt;query($insert) or die(mysqli_error($connect));
        echo '&lt;center&gt;&lt;div class="movingerror" style="color: yellow"&gt;Thank you for voting! Your auth is &lt;b&gt;'.$auth.'&lt;/b&gt;. Please type ::auth '.$auth.' to claim your reward&lt;/div&gt;&lt;/center&gt;';


        $file = fopen("votes.txt", 'w');    
        fwrite($file, --$votes);
        fclose($file);
    }

} 
</code></pre>
