html代码
<form class="form-signin" action="admin?c=login" method="POST">
<label>username:</label>
<input type="text" placeholder="Please enter a user name" name="u" id="username" class="list-input"/>
</div>
<div class="login-input">
<label>password:</label>
<input type="password" placeholder="Please enter a password" name="p" id="password" class="list-input"/>
<input type="hidden" name="c" value="login">
</div>
<div class="login-input">
<label>verification:</label>
<input style="width: 45%;" type="text" type="verification" placeholder="verification code" name="v" class="list-input"/>
<img style="margin-left:10px;" title="点击刷新" src="admin/Delivery/img/image.php" align="absbottom" onclick="this.src='admin/Delivery/img/image.php?'+Math.random();"></img>
</div>
</div>
<div class="login-button">
<input name="login_submit" class="btn btn-lg btn-login btn-block" type="submit" value="登 陆">
</div>
</form>
login.php
if ($_GET['c']=='login'){
if (!empty($_POST['login_submit'])){
require 'PerClass/login.admin.php';
$u = $_POST['u'];
$p = md5($_POST['p'].LOGIN_PROTTY);
$v = $_POST['v'];
if ($v == $_SESSION['Verification.code']){
require_once 'PerClass/filter.admin.php';
LoginFun(FileTer($u), $p, $config);
}else {
echo <<<end
<style type="text/css">*{ padding: 0; margin: 0; } div{ padding: 4px 48px;} body{ background: #fff; font-family: "微软雅黑"; color: #333;font-size:24px} h1{ font-size: 100px; font-weight: normal; margin-bottom: 12px; } p{ line-height: 1.8em; font-size: 36px } a,a:hover,{color:blue;}</style><div style="padding: 24px 48px;"> <h1>:(</h1><p><b>验证码错误!</b>!</p>
<meta http-equiv='refresh' content='1;url=../admin'>
end;
}
}
}
if ($_GET['c']=='forget'){
require 'PerClass/login.admin.php';
if (!empty($_POST['sub_email'])){
require_once 'int_mail.php';
}
}
login.admin.php
function LoginFun($u, $p, $config)
{
$new = new LoginCor($config);
$r = $new->LoginPer($u, $p);
if ($r) {
$_SESSION['user_login'] = md5($r['username'] . $r['password'] . LOGIN_PROTTY);
$_SESSION['nickname'] = $r['nickname'];
$_SESSION['id'] = $r['id'];
header("location:?c=index");
} else {
echo <<<end
<style type="text/css">*{ padding: 0; margin: 0; } div{ padding: 4px 48px;} body{ background: #fff; font-family: "微软雅黑"; color: #333;font-size:24px} h1{ font-size: 100px; font-weight: normal; margin-bottom: 12px; } p{ line-height: 1.8em; font-size: 36px } a,a:hover,{color:blue;}</style><div style="padding: 24px 48px;"> <h1>:(</h1><p><b>登陆失败!</b>!</p>
<meta http-equiv='refresh' content='1;url=../admin'>
end;
}
return $r;
}
function SiteQuery($config)
{
$new = new LoginCor($config);
$r = $new->SiteQuery();
return $r;
}
function UserForget($user, $config)
{
$new = new LoginCor($config);
$r = $new->ForgetPass($user);
return $r;
}
------解决思路----------------------
入口处var_dump($_POST);
------解决思路----------------------
你确认 login.php 被执行到了吗?
<form class="form-signin" action="admin?c=login" method="POST">
依据什么会执行 login.php ???
------解决思路----------------------
请确认请求的页面是否存在。
action="admin?c=login"
------解决思路----------------------
先确定是否有访问到admin?c=login
可以在admin?c=login文中加入
<?php
file_put_contents('sos.txt',json_encode($_REQUEST), true);
?>
看看sos.txt有没有内容。