尋求協助關於網站後台建設:為什麼驗證碼錯誤也能登陸後台

來源:互聯網
上載者:User
header ( "Content-type: text/html; charset=gb2312" );
class chkinput{
var $name;
var $pwd;

function chkinput($x,$y)
{
$this->name=$x;
$this->pwd=$y;
}

function checkinput()
{
include("../conn/conn.php");
$sql=mysql_query("select * from tb_admin where name='".$this->name."'",$conn);
$info=mysql_fetch_array($sql);
if($info==false)
{
echo "";
exit;
}
else
{
if($info[pwd]==$this->pwd)
{
if($number==$_SESSION['code'])
{
header("location:index.php");}
else
{
echo "";
exit;}
}
else
{
echo "";
exit;
}

}
}
}


$obj=new chkinput(trim($_POST[name]),trim($_POST[pwd]));
$obj->checkinput();

?>


回複討論(解決方案)

$number==$_SESSION['code'];

斷點調試輸出驗證碼

如果你的$_SESSION['code']是驗證碼,那$number是什麼,如果是驗證碼為什麼不用POST傳遞過來

我想判斷輸入的驗證碼是否與圖片上的驗證碼是否一致,$_SESSION['code']是圖片的驗證碼,number是我文字框命名的驗證碼,應該如何修改?

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.