我正在尝试使 php 注册表单正常工作,但我遇到了 if/else 语句的问题。但无法完全弄清楚。
ERROR: Parse error: syntax error, unexpected 'if' (T_IF) in E:\xampp\htdocs\test\register.php on line 21
PHP代码:
$username = $_POST['username'];
$password = $_POST['password'];
$repassword = $_POST['repassword'];
$email = $_POST['email'];
if ($username && $password && $repassword && $email)
{
if ($password == $repassword)
{
include ("connect.php");
$query = mysql_query("SELECT * FROM users WHERE username = '$username'");
$numrows = mysql_num_rows($query)
if($numrows == 0) <<- LINE 21
{
echo "Username not taken";
}
else
{
echo "That username is taken!";
}
}
else
echo "Password did not match"; }
else
echo "You did not fill in every field!";
else {//show registration form Stackoverflow cant display it properly.}
也许你们中的一个人看到了这个问题。
提前致谢,
吉姆