Home > Backend Development > PHP Tutorial > linux下类无法实例化.该怎么处理

linux下类无法实例化.该怎么处理

WBOY
Release: 2016-06-13 12:22:51
Original
903 people have browsed it

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 />
Copy after login

<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 />
Copy after login

------解决思路----------------------
打开 php 的错误显示功能

多半是嵌入文件的路径不对
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template