我正在制作一个通过包含连接到 mysql 数据库的注册页面。当我尝试应用一些规则(没有空的电子邮件、用户名或密码)时,出了点问题......
当我运行脚本时,它只给了我 HTTP 500(内部服务器错误):
我已将脚本粘贴在下面...
[对不起我糟糕的编码技能...我是新手!]
if ($submit) {
$check = empty($_POST['username']) || empty($_POST['password']) || empty($_POST['email']))
if ($check == true) {
echo "Fill all the info!";
}
else {
$check1 = mysql_num_rows(mysql_query("SELECT * FROM accounts WHERE login='".$username."'"));
if ($check1 == 0) {
$password = base64_encode( pack( "H*", sha1( utf8_encode( $password))));
mysql_query("INSERT INTO accounts VALUES ('".$username."', '".$password."', '".$lastactive."', '0', '".$IP."', '1', '".$email."')");
echo "<b><font color='gray'>You have been registered. Visit the login page in order to login and edit your account.</b>";
}