我在过去几年里使用过这个脚本但突然出现了invaild用户或密码的错误,我没有改变代码和服务器的任何内容,所有的东西都有数据库/用户等等。任何人都有任何想法?以下是代码
<?php
session_start();
error_reporting(E_ALL | E_WARNING | E_NOTICE);
ini_set('display_errors', TRUE);
$username = $_POST['emailnic'];
$username = $_POST['password'];
$INic=substr($username,0,5)."-".substr($username,5,7)."-".substr($username,12,1);
include('con.php');
$Query = mysql_query("SELECT NicNo,Email,Password,AcStatus,Actype FROM person WHERE NicNo='$INic' && Password='$password' || Email='$username' && Password='$password' ") or die(mysql_error());
$show=mysql_num_rows($Query);
$result=mysql_fetch_array($Query);
mysql_close($dbhandle);
if( $show >=1 )
{
$s=$result['AcStatus'];
$t=$result['Actype'];
$_SESSION['user_ACType']=$result['Actype'];
$_SESSION['user_NIC']=$result['NicNo'];
if($s==1 and $t==3)
{
header( 'Location: ../index_login.php' ) ;
}
else if($s==1 && $t==2)
{
header( 'Location: ../admin2.php' ) ;
}
else if($s==1 && $t==1)
{
header( "Location:../Admin.php" ) ;
}
else if($s==0 && $t==0)
{
$_SESSION['error'] = "Your Account Avtivated After Varification!!!";
header( "Location:../login.php" ) ;
}
}
else{
$_SESSION['error'] = "Invalid User Name or Password!!!";
header( "Location:../login.php" ) ;
}
?>
感谢 香美
答案 0 :(得分:0)
Fromwhereyouaregettigvalofof $ password.checkthis =&gt; $ username = $ _POST ['emailnic']; $ username = $ _POST ['password'];