正如我已经尝试过但 nodbody 帮助了我,我会再试一次。我想为想要注册此脚本的人设置一个限制为 16 可以请有人编辑我的脚本并将其发布在这里以便我可以复制粘贴它因为我在编码方面非常糟糕所以在我尝试之前总是会出错请有人只是简单地用 limt 16 发布我的代码。谢谢你们,如果有人这样做,那就太好了
这是脚本
<?php
$error_message = "";
if ($_SERVER['REQUEST_METHOD'] == 'POST')
{
$action = isset($_POST['action']) ? $_POST['action'] : '';
$mysql_server = 'X';
$mysql_username = 'X';
$mysql_password = 'X';
$mysql_database = 'X';
$mysql_table = 'LOL';
$success_page = 'X';
if ($action == 'signup')
{
$newusername = $_POST['username'];
$newemail = $_POST['email'];
$newpassword = $_POST['password'];
$confirmpassword = $_POST['confirmpassword'];
$newfullname = $_POST['fullname'];
if ($newpassword != $confirmpassword)
{
$error_message = 'Password and Confirm Password are not the same!';
}
else
if (!ereg("^[A-Za-z0-9_!@$]{1,50}$", $newusername))
{
$error_message = 'Team name is not valid, please check and try again!';
}
else
if (!ereg("^[A-Za-z0-9_!@$]{1,50}$", $newpassword))
{
$error_message = 'Password is not valid, please check and try again!';
}
else
if (!ereg("^.+@.+\..+$", $newemail))
{
$error_message = 'Email is not a valid email address. Please check and try again.';
}
$db = mysql_connect($mysql_server, $mysql_username, $mysql_password);
mysql_select_db($mysql_database, $db);
$sql = "SELECT username FROM ".$mysql_table." WHERE username = '".$newusername."'";
$result = mysql_query($sql, $db);
if ($data = mysql_fetch_array($result))
{
list($username, $password, $email, $fullname) = explode('|', trim($line));
if ($newusername == $username)
{
$error_message = 'Team name already used. Please select another username.';
}
}
if (empty($error_message))
{
$crypt_pass = md5($newpassword);
$sql = "INSERT `".$mysql_table."` (`username`, `password`, `fullname`, `email`, `active`) VALUES ('$newusername', '$crypt_pass', '$newfullname', '$newemail', 1)";
$result = mysql_query($sql, $db);
mysql_close($db);
$mailto = $newemail;
$subject = 'X';
$message = 'X';
$message .= "\r\nX";
$message .= "\r\n ";
$message .= "\r\nTeam name for the upcoming tournament: ";
$message .= $newusername;
$message .= "\r\nYour password: ";
$message .= $newpassword;
$message .= "\r\n ";
$message .= "\r\n ";
$message .= "\r\nX";
$message .= "\r\nX";
$header = "From: X"."\r\n";
$header .= "Reply-To: X"."\r\n";
$header .= "MIME-Version: 1.0"."\r\n";
$header .= "Content-Type: text/plain; charset=utf-8"."\r\n";
$header .= "Content-Transfer-Encoding: 8bit"."\r\n";
$header .= "X-Mailer: PHP v".phpversion();
mail($mailto, $subject, $message, $header);
header('Location: '.$success_page);
exit;
}
}
}
?>