只是尝试一些教程!无法弄清楚为什么我在表单操作行上出现错误
<?php
if (isset($_POST['Username'])&&isset($_POST['password'])) {
$username = $_POST['Username'];
$password = $_POST['password'];
if (!empty($Username)&&!empty($password)) {
echo 'OK';
} else {
echo 'You must supply an email and a password.';
}
?>
<form action="<?php echo $current_file; ?>" method="POST">
Email: <input type="text" name="username"> Password: <input type="password" name="password">
<input type ="submit" value = "Log In" />
</form>
答案 0 :(得分:3)
$username = $_POST['Username'];
$password = $_POST['password'];
if (!empty($Username)&&!empty($password)) {
你有两个变量$ username和$ Username - 应该是一样的吗?
答案 1 :(得分:0)
您需要关闭初始if条件块
答案 2 :(得分:0)
可能是因为没有定义 $ current_file 吗?或者您是否在代码之前定义它?