代碼和值正常的情況下php無法接收post資料,求解。

來源:互聯網
上載者:User
html代碼



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;
}
}
}

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;
}
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 被執行到了嗎?


依據什麼會執行 login.php ???

能說詳細點麼,小白。不是很懂

請確認請求的頁面是否存在。
action="admin?c=login"

先確定是否有訪問到admin?c=login

可以在admin?c=login文中加入
file_put_contents('sos.txt',json_encode($_REQUEST), true);
?>

看看sos.txt有沒有內容。

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.