出于某种原因,我无法发布我的 PHP 表单。我尝试在 login.php 中运行打印语句,但没有任何结果。
<form action="login.php" method="post" id="loginForm">
<div class="input-prepend login-input">
<span class="add-on"><i class="icon-envelope"></i></span>
<input class="span2" name="email" type="email" placeholder="Email address" required>
</div>
<div class="input-prepend login-input">
<span class="add-on"><i class="icon-key"></i></span>
<input class="span2" name="password" type="password" placeholder="Password" required>
<!--<i class="icon-eye-open password" id="eye"></i>-->
</div>
<input class="btn btn-primary login-input" id="loginButton" type="submit" value="Login"/>
<input class="btn btn-small login-input" id="cancelButton" type="button" value="Cancel"/>
</form>
当我提交表单时,绝对没有任何反应,为什么会这样?这是我的 login.php:
<?php
include 'core/init.php';
if(empty($_POST) === false){
$email = $_POST['email'];
$password = $_POST['password'];
#HTML5 should have checked this, just as an extra precaution
if(empty($email) || empty($password)){
$errors[] = "Please enter your email and password";
}
else if(user_exists($email) === false){
$errors[] = "User does not exist";
}
else if(user_active($email) === false){
$errors[] = "Your account has not been activated"
}
else{
#log in the user
}
print_r($errors);
}
?>