时间:2021-07-01 10:21:17 帮助过:15人阅读
ini_set ( "error_reporting", "E_ALL & ~E_NOTICE" );
include '../bld_controller/LoginHandle.class.php';
$username = $_POST['username'];
$password = $_POST['password'];
$login = new LoginHandle();//运行到这一步就停止了
$flag = $login->check_psw($username, $password);
if($flag)
{
session_start();
$_SESSION['username'] = $username;
echo "";
}
else
{
echo "";
}
?>
class LoginHandle
{
var $db = "";
var $flag ="";
function __construct()
{
$this->db = new DBhelper("yaoinger", "123456", "108.163.234.83:2082", "banklinksdisbution");
$this->flag = $this->db->connect();
}
function check_psw($username,$password)
{
$SQL = "SELECT u_password FROM bld_users WHERE u_name ='$username'";
$result ="";
if($this->flag)
{
$result = $this->db->select($SQL);
}
$psw = "";
if($result){
$value= mysql_fetch_assoc($result);
}
$psw = $value['u_password'];
return $psw == $password;
}
}