是不是 最下面的else内有错误呢??请高手指点指点,在线等!!!:-)

解决方案 »

  1.   

    window.parent.location(head.php)
    to
    window.parent.location("head.php")
      

  2.   

    你试试这样行不行,同时你要检查你有没有语法之类的错误:<form method="POST" action="checklog.php" name="formlogin" >
    <table >
      <tr>
         <td >登陆名:</td>
         <td><input type=text name=logname size =18></td>
      </tr>
      <tr>
         <td >密&nbsp; 码:</td>
         <td><input type=password name=logpwd size =19></td>
      </tr>
      <tr>
         <td colspan =2 align =center ><input type =submit name=b1 value =登陆 ><input type=button name=b2 value =关闭 onclick ="VBScript:window.close()"></td>  </tr>
    </table>这个页面的名字叫 checklpg.php
    <?php
    $dbh=mysql_connect(*******','******','*****');
    if(!$dbh)
    {
    echo "没连接到数据库".strval($dbh);
    exit;
    }
    else
    {
     echo "连接成功";
    }
    $name=$_POST["logname"];
    $pwd=$_POST["logpwd"];
    $query="select u_id,u_pwd from users where u_id='$name' and u_pwd='$pwd'";$rsh=mysql_db_query('paper',$query,$dbh);
    $row=mysql_fetch_array($rsh);
    echo $name.$pwd;
    if($row==false)
    {
    echo "没有该用户";
    mysql_free_result($rsh);
    mysql_close($dbh);
    exit;
    }
    else if($row["u_pwd"]!=$pwd)
    {
    echo "密码不正确";
    mysql_free_result($rsh);
    mysql_close($dbh);
    exit;
    }
    else
    {
    echo '<meta HTTP-EQUIV="Refresh" Content="0;URL=head.php">';
    }?>
      

  3.   


    你的checklpg.php不用写的这么累八