首页如下:<body>
        <div id="header"></div>
        <div id="line"></div>
        <div id="content">
            <form id="loginform" action="welcome.php" method="get">
                <table id="login_table" align="center" border="0" cellpadding="0" cellspacing="0" width="100%">
                    <tr>
                        <td width="100%" colspan="2" align="center">欢迎</td>
                    </tr>
                    <tr>
                        <td width="30%" align="center" scope="row">用户名:</td>
                        <td width="70%"><input type="text" id="username" name="username" /></td>
                    </tr>
                    <tr>
                        <td width="30%" align="center" scope="row">密&nbsp;&nbsp;&nbsp;码:</td>
                        <td width="70%"><input type="password" id="pwd" name="pwd" /></td>
                    </tr>
                    <tr>
                        <td width="100%" colspan="2" align="center"><input type="submit" id="sub" name="sub" value="登 录" /></td>
                    </tr>
                </table>
            </form>
        </div>
        <hr width="100%"/>
        <div id="footer">
            <p align="center">&copy;2010-2012 </p>
        </div>
    </body>欢迎页面如下:<head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>welcome</title>
    </head>
    <body>
        <?php
            require("../DAO/OperateDB.php");
            $name=$_GET["username"];
            $pwd=$_GET["pwd"];            $op=new OperateDB();
            $users=$op->checkUser($name);
            $data=mysql_fetch_array($users);            echo "用户名:".$data["userName"]."密码:".$data["passWord"];
        ?>
    </body>OperateDB类如下:require("../DAO/ConnectionManager.php");
require("../Readprop.php");
/**
 * Description of selectDB
 * 对数据库进行的增,删,查,改的操作
 * @author Administrator
 */
class OperateDB{
    
    //连接数据库的方法
    function connectionDB(){
        $read=new Readprop();
        $propname=$read->getName();
        $DBServer=trim($propname[0]);
        $DBName=trim($propname[1]);
        ConnectionManager::getConnection($DBServer,$DBName);
    }    //查询单个用户
    function checkUser($name){
        $this->connectionDB();
        $sql="select * from users where userName=".$name;
        $result_user=mysql_query($sql);
        return $result_user;
    }
}在提交首页之后,欢迎页面报错,报错信息如下:
 Warning: require(../DAO/OperateDB.php) [function.require]: failed to open stream: No such file or directory in D:\PHP_Project\CRM\welcome.php on line 13Fatal error: require() [function.require]: Failed opening required '../DAO/OperateDB.php' (include_path='.;D:\web\Php5.2.9-2\pear') in D:\PHP_Project\CRM\welcome.php on line 13请高人帮忙看看!

解决方案 »

  1.   

    /DAO/OperateDB.php
    确定下文件路径是否正确,检查是否存在这个文件
      

  2.   

    引用文件出错吧
    require_once dirname(__FILE__).'/'.'../common/db/connect_db.php';
    这样子引用比较好的说
      

  3.   

    这个好象是很普通的引用目录错误
    我看了这代码,好象楼主用PHP也设了个DAO层
    感觉楼主不像是连引用目录错误都要发贴求助的人,相信已经解决!