no message

This commit is contained in:
2025-10-18 14:46:52 +08:00
commit 7a84025b05
387 changed files with 75711 additions and 0 deletions

129
user/new.php Normal file
View File

@@ -0,0 +1,129 @@
<?php
include './email.php';
session_start();
// 定义常量
define('MAX_REQUESTS_PER_MINUTE', 5);
define('MIN_PASSWORD_LENGTH', 6);
define('MAX_PASSWORD_LENGTH', 20);
// 获取访问者的 IP 地址
$ipAddress = $_SERVER['REMOTE_ADDR'];
// 检查访问频率
$requestFile = './request_count/' . $ipAddress . '.txt';
if (file_exists($requestFile)) {
$data = @file_get_contents($requestFile);
list($lastRequestTime, $requestCount) = explode(',', $data);
// 检查如果当前时间与最后请求时间超过1分钟则重置计数
if (time() - $lastRequestTime > 60) {
$requestCount = 1;
$lastRequestTime = time();
} else {
if ($requestCount >= MAX_REQUESTS_PER_MINUTE) {
echo "请求过于频繁,请稍后再试。";
exit;
}
$requestCount++;
}
} else {
$requestCount = 1;
$lastRequestTime = time();
}
// 记录访问次数
file_put_contents($requestFile, "$lastRequestTime,$requestCount");
// 获取 POST 数据
$user = $_POST['user'];
$pass = $_POST['pass'];
$cap = $_POST['cap'];
if ($cap != $_SESSION['captcha']) {
echo '图片验证码有误!<meta http-equiv="refresh" content="2;url=./register.fx">';
// 生成随机验证码
$captcha_code = '';
for ($i = 0; $i < 5; $i++) {
$char = chr(rand(97, 122)); // 生成小写字母
$captcha_code .= $char;
}
$_SESSION['captcha'] = $captcha_code;
exit;
}
// 用户输入验证
if (!is_numeric($user)) {
echo "用户名必须是数字";
exit;
}
if (!preg_match('/^[a-zA-Z0-9]{' . MIN_PASSWORD_LENGTH . ',' . MAX_PASSWORD_LENGTH . '}$/', $pass)) {
echo "密码必须是字母和数字的组合,并且长度在" . MIN_PASSWORD_LENGTH . "" . MAX_PASSWORD_LENGTH . " 之间";
exit;
}
// 处理用户输入
$user_v = v_in($user);
$pass_v = v_in($pass);
// 定义要检查的文件路径
$directoryPath = './can/' . $user; // 目录路径
// 如果目录不存在,创建目录
if (is_dir($directoryPath)) {
echo "账号已存在";
exit; // 添加 exit 防止继续执行后续代码
}
// 定义要检查的文件路径
$directoryPath = './can/' . $user . '/' . $pass; // 目录路径
$filePath = $directoryPath . '/lock.txt'; // 文件路径
// 如果目录不存在,创建目录
if (!is_dir($directoryPath)) {
mkdir($directoryPath, 0755, true); // 创建多级目录
}
// 检查文件是否存在
if (file_exists($filePath)) {
echo "账号已存在";
exit; // 添加 exit 防止继续执行后续代码
}
// 获取当前时间
$currentDateTime = date("Y年m月d日 H时i分s秒");
// 准备内容
$content = "注册IP: $ipAddress\n";
$content .= "注册时间: $currentDateTime\n";
// 创建文件,并写入内容
if (@file_put_contents($filePath, $content) !== false) {
$user_v = urlencode($user_v);
$pass_v = urlencode($pass_v);
$url = "https://host.fuxsto.cn/user/ver.fx?uk=".$user_v."&pk=".$pass_v;
$con = '<!DOCTYPE html><html lang="zh-CN"><head><meta charset="UTF-8"><meta name="viewport" content="width=device-width, initial-scale=1.0"><title>邮件激活</title><style>body{font-family:Arial,sans-serif;background-color:#f4f4f4;margin:0;padding:20px;text-align:center;}h1{color:#333;}h2{color:#555;}p{color:#666;}a.button{display:inline-block;padding:15px 30px;background-color:#4CAF50;color:white;text-align:center;text-decoration:none;border-radius:5px;transition:background-color 0.3s ease;border:none;font-size:16px;box-shadow:0 4px 6px rgba(0,0,0,0.1);}a.button:hover{background-color:#45a049;}</style></head><body><h1>Fuxsto Host V2</h1><h2>邮件激活</h2><p>点击下面的按钮来激活您的账号!</p><a href="'.$url.'" class="button">激活账户</a><p>如果不能的话请复制下面的链接使用浏览器打开</p><p><a href="#">'.$url. '</a></p><p>如果您并未注册请忽略此邮件</p></body></html>';
if (@sendMail($user . '@qq.com', '#Fuxsto Host 邮箱激活', $con)) {
echo '激活邮件已发送至您的QQ邮箱!<meta http-equiv="refresh" content="3;url=./">';
// 生成随机验证码
$captcha_code = '';
for ($i = 0; $i < 5; $i++) {
$char = chr(rand(97, 122)); // 生成小写字母
$captcha_code .= $char;
}
$_SESSION['captcha'] = $captcha_code;
exit;
}
} else {
echo "注册失败:001";
}
?>