请好心人帮忙改一下错Warning: chkinput::include(conn/conn.php) [chkinput.include]: failed to open stream: No such file or directory in D:\AppServ\www\xiaoyuan\admin\chkadmin.php on line 15Warning: chkinput::include() [function.include]: Failed opening 'conn/conn.php' for inclusion (include_path='.;C:\php5\pear') in D:\AppServ\www\xiaoyuan\admin\chkadmin.php on line 15Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in D:\AppServ\www\xiaoyuan\admin\chkadmin.php on line 16Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in D:\AppServ\www\xiaoyuan\admin\chkadmin.php on line 17下面是chkadmin.php的代码
<?php
header ( "Content-type: text/html; charset=gb2312" ); //设置文件编码格式
 class chkinput{
   var $name;
   var $pwd;   function chkinput($x,$y)
    {
     $this->name=$x;
     $this->pwd=$y;
    }   function checkinput()
   {
     include("conn/conn.php");
     $sql=mysql_query("select * from tb_admin_user where name='".$this->name."'",$conn);
     $info=mysql_fetch_array($sql);
     if($info==false)
       {
          echo "<script language='javascript'>alert('不存在此管理员!');history.back();</script>";
          exit;
       }
      else
       {
          if($info[pwd]=='$pwd'){
               header("location:index.php");
            }
          else
           {
             echo "<script language='javascript'>alert('密码输入错误!');history.back();</script>";
             exit;
           }      }    
   }
 }
    $obj=new chkinput(trim($_POST[name]),md5(trim($_POST[pwd])));
    $obj->checkinput();?>下面是 admin_user.php的代码
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../css/font.css" rel="stylesheet">
</head>
<body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<p>&nbsp;</p>
<p> 
</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<script language="javascript">
  function chkinput(form){
    if(form.name.value==""){
  alert("请输入用户名!");
  form.name.select();
  return(false);
}
if(form.pwd.value==""){
  alert("请输入用户密码!");
  form.pwd.select();
  return(false);
}
return(true);
  }
</script>
<form name="form1" method="post" action="chkadmin.php" onSubmit="return chkinput(this)">
  <table width="545" border="0" align="center" cellpadding="0" cellspacing="0" id="__01">
<tr>
<td height="167" background="images/admin_user.jpg">&nbsp;</td>
</tr>
<tr>
<td height="201" align="right" background="images/default_02.gif"><table width="500" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="66" height="32" align="center">用户名:</td>
            <td width="112" align="center"><input type="text" name="name" size="14" maxlength="20" class="inputcss"></td>
            <td width="60" align="center">&nbsp;密&nbsp;码:</td>
            <td width="112" align="center"><input type="password" name="pwd" size="14" maxlength="20" class="inputcss"></td>
            <td width="150">
      <div align="center">
        <input name="imageField" type="image" src="images/default_07.gif" align="middle" width="74" height="24" border="0">
            </div></td>
</tr>
      </table></td>
</tr>
</table>
</form>
</body>
</html>

解决方案 »

  1.   


    include(conn/conn.php)
    确保你这个路径和文件名是正确的先
      

  2.   

    提示的是
    include(conn/conn.php)路径不对。
      

  3.   

    根据报错来分析,很明显是include("conn/conn.php");这条语句有问题,极大可能是你这个文件没有导入成功,最好就检查一下路径看是否正确。因为这个文件的问题,导致了下面的报错。
      $sql=mysql_query("select * from tb_admin_user where name='".$this->name."'",$conn);
      $info=mysql_fetch_array($sql);
      

  4.   

    include(conn/conn.php)路径不对,像这种问题,尽量的用完整路径