好的,我做了一个激活页面,这是它的代码
if ($_SERVER['REQUEST_METHOD']== "GET")
{
$email=mysql_real_escape_string($_GET['email']);
$code=mysql_real_escape_string($_GET['actcode']);
$tab='SELECT email, hash, activate
FROM register WHERE email="'.$email.'"'.'AND hash="'.$code.'"'.'and activate="0"';
$table=mysql_query($tab);
$query=mysql_num_rows($table);
if($query > 0)
{
$up='UPDATE register
SET activate="1"
WHERE email="'.$email.'"';
$update=mysql_query($up);
if (!$update)
{
print " not updated<br/>";
}
else
{
print "<span class=\"active\"><strong>Account Activated.Kindly click<a href=\"login.php\"> HERE</a> to continue.</strong></</span><br/>";
die();
}
}
elseif($query <= 0)
{
print "<span class=\"active\"><strong>Invalid information provided, please try again.</strong></</span><br/>";
}
}
它一切正常,但我的任务是让知道变量中的值来自“GET”,如果 GET 而不是 var a == true 如果为真,那么我可以更新激活 =“1”。
需要帮忙!