2 回答
TA贡献1820条经验 获得超2个赞
建议:尽可能使用仪器,并将您发现的内容发回。
例如:
<?php
echo "vkey=" . $_GET['vkey'] . "...<br/>";
if (isset($_GET['vkey'])) {
$vkey = $_GET['vkey'];
echo "vkey=" . $vkey . "...<br/>";
$mysqli = NEW MySQLi ('server','username','password','db');
echo "mysqli: SUCCEEDED...<br/>";
$resultSet = $mysqli->query("SELECT verified, vkey FROM registration WHERE verified = 0 AND vkey = '$vkey' LIMIT 1");
echo "resultSet: SUCCEEDED...<br/>";
echo "resultSet->num_rows=" . $resultSet->num_rows . "...<br/>";
if ($resultSet->num_rows == 1)
{
$update = $mysqli->query("UPDATE registration SET verified = 1 WHERE vkey = '$vkey' LIMIT 1");
echo "update: SUCCEEDED...<br/>");
if($update){
echo "Your account has been verified. You may now login.";
} else {
echo $mysqli->error;
}
}
else
{
echo "This account invalid or already verified";
}
} else {
echo "ERROR STATE: " . $mysqli->error . "...<br/>";
die("Something went wrong");
}
?>
不,我想不出“......为什么 md5 字符串”可能是罪魁祸首。但我认为上述工具(或类似工具)可能会帮助我们确定问题发生的确切位置……以及如何解决它。
'希望有帮助...
TA贡献1864条经验 获得超2个赞
您的代码在 $_POST 数组中而不是 $_GET 中查找
if (isset($_GET['vkey'])) {
$vkey = $_GET['vkey'];
- 2 回答
- 0 关注
- 143 浏览
添加回答
举报