日期:2014-05-17  浏览次数:20459 次

帮忙改一下错
请好心人帮忙改一下错

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 15

Warning: 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 15

Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in D:\AppServ\www\xiaoyuan\admin\chkadmin.php on line 16

Warning: 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"