php代码停止运行
过去几年我一直在使用这个脚本,但突然它给出了invaild用户或密码的错误,我没有更改任何代码和服务器,所有的东西都有db/用户等。有人知道吗?下面是代码php代码停止运行,php,mysql,Php,Mysql,过去几年我一直在使用这个脚本,但突然它给出了invaild用户或密码的错误,我没有更改任何代码和服务器,所有的东西都有db/用户等。有人知道吗?下面是代码 <?php session_start(); error_reporting(E_ALL | E_WARNING | E_NOTICE); ini_set('display_errors', TRUE); $username = $_POST['emailnic']; $usernam
<?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" ) ;
}
?>
从中获取$password的TigValueof。选中此=>$username=$\u POST['emailnic'];
$username=$_POST['password'] 看看。你很容易接受sql注入。请使用mysqli或pdo。如果它工作多年,一定有什么变化。您是否收到任何错误?我先看看你的查询,那里的条件没有很好的格式化。你使用的是哪个PHP版本?在新的php页面中运行
代码,以了解版本。如果你只是想问一个问题然后离开,而不回答我们的评论,人们会厌倦等待你的回答而离开这个问题,降低您获得帮助的机会。从根文件夹中的另一个文件仅传递这些值还有一件事在我的pc中的本地服务器xamp上一切正常