我正在为我的一个新项目构建一个高级登录系统,但是我遇到的问题是最简单的部分。发布的表单数据。
未在以下页面之间传输的数据。我已经研究了一个小时,但我找不到问题。
你们的帮助将不胜感激,谢谢。
代码和注释:
登录.php:
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Live Home :: Client Login</title>
<link rel="stylesheet" href="css/core.core.css" type="text/css" />
<script src="http://code.jquery.com/jquery.min.js" type="text/javascript"></script>
<script src="js/common.js" type="text/javascript"></script>
<script src="bundles/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
</head>
<body>
<header>
<div class="bar"></div>
<div class="btm"></div>
</header>
<section id="login">
<div class="drop">
<div class="top">
<h2>Live Home</h2>
<hr class="sec-sep" style="width:100px;" />
</div>
<section id="FOH">
<div class="inner">
<form class="form-horizontal" method="post" id="logon-form" action="auth/logon.php">
<div class="control-group">
<label class="control-label" for="inputEmail">Username / Email : </label>
<div class="controls">
<input type="text" id="inputEmail" placeholder="Username / Email" />
</div>
</div>
<div class="control-group">
<label class="control-label" for="inputPassword">Password : </label>
<div class="controls">
<input type="password" id="inputPassword" placeholder="Password" />
</div>
</div>
<div class="control-group">
<a id="login-btn" class="btn btn-primary btn-mid-login">Sign in</a>
</div>
</form>
</div>
<div class="login-loader"></div>
</section>
</div>
</section>
<script type="text/javascript">
$(window).bind('load resize', setPos);
function setPos(){
$('#login').css({
'margin-top': ($(window).height() / 2) - ($('#login').height() / 2) - (($(window).height() / 100) * 10)
});
}
$(document).ready( function() {
$('#login-btn').click( function() {
$('.inner').stop(true, true).fadeOut({ duration: 700, queue: false }).slideUp(700);
$('.login-loader').delay(700).fadeIn(300);
setTimeout(function() {
$('#logon-form').submit();
},2800);
});
});
</script>
</body>
</html>
身份验证/logon.php:
<?php
/**=====================================================================
logon.php
This file logs users into the main system.
=======================================================================*/
class access {
function authenticate () {
$user_request = $_POST;
if(isset($user_request)){
$username = $user_request['inputEmail'];
$password = $user_request['inputPassword'];
var_dump($_POST);
}else{
header("Location: ../../login.php");
}
}
}
$access = new access();
$access -> authenticate();
?>
要查看正在运行的页面,请单击此处。