PHP- Getting var from url checking with mysql
<p>So the connection has been established and here is the code. What im trying to do is get two var from the url and save them as a var. I am getting an error and the php is not working and i know the information in the url is correct and matched the database. The error is "The url is either invalid or you already have activated your account." which is what the php returns if there isnt a match so im guessing that the disconnect is between the url and var setting. 
   Code:</p>

<pre><code>if(isset($_GET['email']) &amp;&amp; !empty($_GET['email']) AND isset($_GET['hash']) &amp;&amp;     !empty($_GET['hash'])){  
// Verify data  
$email = mysql_escape_string($_GET['email']); // Set email variable  
$hash = mysql_escape_string($_GET['hash']); // Set hash variable  

$search = mysql_query("SELECT email, hash, active FROM users WHERE email='".$email."' AND hash='".$hash."' AND active='0'") or die(mysql_error());  
$match  = mysql_num_rows($search);  

if($match &gt; 0){  
    // We have a match, activate the account  
    mysql_query("UPDATE users SET active='1' WHERE email='".$email."' AND hash='".$hash."' AND active='0'") or die(mysql_error());  
    echo '&lt;div class="statusmsg"&gt;Your account has been activated, you can now login&lt;/div&gt;';  
}else{  
    // No match -&gt; invalid url or account has already been activated.  
    echo '&lt;div class="statusmsg"&gt;The url is either invalid or you already have activated your account.&lt;/div&gt;';  
}  

}else{  
// Invalid approach  
echo '&lt;div class="statusmsg"&gt;Invalid approach, please use the link that has been send to your email.&lt;/div&gt;';  
}  
?&gt;
</code></pre>

<p>URL:</p>

<p><a href="http://www.aliahealthcare.com/verify.php?email=" rel="nofollow">http://www.aliahealthcare.com/verify.php?email=</a>'.me@email.com.'&amp;hash='.67f7fb873eaf29526a11a9b7ac33bfac.'</p>
