それを機能させる方法を見つけることができます。アカウントを有効にしてログインできないため、Mysql 4 を Mysql 5 にアップグレードし、PHP を 5.2 に変更しました。このコードの何が問題になっていますか?
include_once("conn.php");
$check_num = $_GET['c'];
$exists ="SELECT * FROM registry WHERE check = '$check_num'";
$eresult = mysql_query($exists);
if (!$eresult)
{
die('<p>Error performing query: ' . mysql_error() . '</p>');
}
$row = mysql_fetch_array($eresult);
$key = $row['regkey'];
$name = $row['title'] . ' ' . $row['name'] . ' ' . $row['surname'];
$user = $row['username'];
if (mysql_num_rows($eresult) == 1)
{
$selected = mysql_query($eresult);
$sql = " UPDATE registry
SET check = 'ok'
WHERE regkey = $key";
$result = mysql_query($sql);
if (mysql_affected_rows() == 1)
{
$message = "The account $user has now been activated.";
echo "<script type=\"text/javascript\">
alert('The account $user has now been activated.');
</script>
<script>document.location.href='../index.php'</script>";
}
}
else
{
$message = "There was a problem with your check value, please try copy and pasteing the URL again. ";
}
echo $message;
?>