linux下类无法实例化....
本帖最后由 YAO__INGS 于 2015-07-11 13:00:11 编辑 自定义的LoginHandle无法实例化,测试mysql可以链接...不知道为什么...
LoginHanlde.php
<br /><br /><?php <br />ini_set ( "error_reporting", "E_ALL & ~E_NOTICE" );<br />include '../bld_controller/LoginHandle.class.php';<br />$username = $_POST['username'];<br />$password = $_POST['password'];<br />$login = new LoginHandle();//运行到这一步就停止了<br />$flag = $login->check_psw($username, $password);<br />if($flag)<br />{<br /> session_start();<br /> $_SESSION['username'] = $username;<br /> echo "<script language='javascript'>location.href='main.php'</script>";<br />}<br />else<br />{<br /> echo "<script language='javascript'>location.href='login.php'</script>";<br />}<br /><br /><br /><br /><br />?><br /><br />
Nach dem Login kopieren
<br /><?php include '../bld_model/DBhelper.class.php';<br />class LoginHandle<br />{<br /> var $db = "";<br /> var $flag ="";<br /> function __construct()<br /> {<br /> $this->db = new DBhelper("yaoinger", "123456", "108.163.234.83:2082", "banklinksdisbution");<br /> $this->flag = $this->db->connect();<br /> <br /> }<br /> function check_psw($username,$password)<br /> {<br /> $SQL = "SELECT u_password FROM bld_users WHERE u_name ='$username'";<br /> $result ="";<br /> if($this->flag)<br /> {<br /> $result = $this->db->select($SQL);<br /> }<br /> $psw = "";<br /> if($result){<br /> $value= mysql_fetch_assoc($result);<br /> }<br /> $psw = $value['u_password'];<br /> return $psw == $password;<br /> <br /> }<br /> <br /> <br />}<br /><br /><br /><br />
Nach dem Login kopieren
------解决思路----------------------打开 php 的错误显示功能
多半是嵌入文件的路径不对