源代码: old_verify.php
<?php
if (isset($_GET["token"])) {
$token = urldecode($_GET["token"]);
// 读取 '等待邮箱验证.json'
$pendingVerification = json_decode(file_get_contents(__DIR__ . "/Assets/data/json/等待邮箱验证.json"), true);
// 找到对应的记录并检查Token
foreach ($pendingVerification as $key => $entry) {
if ($entry["token"] === $token) {
// 将数据移到 审核中的id详细信息 'pending.json'
$pending = json_decode(file_get_contents(__DIR__ . "/Assets/data/json/pending.json"), true);
$pending[] = [
"id" => $entry["id"],
"domain" => $entry["domain"],
"description" => $entry["description"],
"master" => $entry["master"],
"email" => $entry["email"],
"join_date" => $date = date("F j, Y, g:i a")
];
file_put_contents(__DIR__ . "/Assets/data/json/pending.json", json_encode($pending));
// 从 '等待邮箱验证.json' 中删除该记录
unset($pendingVerification[$key]);
file_put_contents(
__DIR__ . "/Assets/data/json/等待邮箱验证.json",
json_encode(array_values($pendingVerification))
);
// 读取 'pendingid.json' 并追加新的ID
$pendingId = json_decode(file_get_contents(__DIR__ . "/Assets/data/json/pendingid.json"), true);
// 生成新的键值对,键值对的键为递增的最大整数,值为该 ID
$newKey = (!empty($pendingId)) ? (string)(max(array_keys($pendingId)) + 1) : "0";
$pendingId[$newKey] = $entry["id"];
// 将更新后的数据写入 'pendingid.json'
file_put_contents(__DIR__ . "/Assets/data/json/pendingid.json", json_encode($pendingId));
echo "<center><h1>邮箱验证成功!请耐心等待审核,审核通过后会发送邮件通知您!</h1></center>";
exit;
}
}
http_response_code(404);
} else {
http_response_code(404);
}
这个网站由wusheng233制作,生成了静态页面