我有处理用户然后将他们重定向到用户主页的这段代码。
<?php
$username = $_POST['username'];
$password = $_POST['pwd'];
$file = file_get_contents("userdb.html");
if(!strpos($file, $username)) {
echo "Your username was not found in our database. Please go back and try again.";
} else {
echo "Redirecting...";
if (md5($password) == !strpos($file, (md5($password))) {
echo "Redirecting..."
header ('Location: ./userhome.php')
} else {
print "Whoops! Your password seems to be incorrect. Go back and try again."
}
}
?>
我得到了错误:
Parse error: syntax error, unexpected '{' in userprocess.php on line 11
有人可以告诉我这个问题吗?我认为这可能是 if 语句中的 if ,但我能做些什么来替代?谢谢。