把echo "<META HTTP-EQUIV='Refresh' CONTENT='2; URL=../jian/index.php'>";
换成echo "error";
试下,如果可以打印说明是"<META HTTP-EQUIV='Refresh' CONTENT='2; URL=../jian/index.php'>";语法问题,改下就好了

解决方案 »

  1.   

    $dataresult= mysql($database,"select * from $tablename where '".$username."'like '%".$password."%');
    或者直接
    $dataresult= mysql($database,"select * from $tablename where '$username' like '$password%');
      

  2.   

    以前用过<META HTTP-EQUIV='Refresh' CONTENT='2; URL=../jian/index.php'>来跳转页面,但是发现如果仅仅有这一句,不能正常跳转,除非你写一个完整的HTML文件
    echo <<<HTML
    <html>
    <head>
      <title>ERROR</title>
      <META HTTP-EQUIV="Refresh" CONTENT="2; URL=../jian/index.php"> 
    </head>
    <body>
    <p align="center">ERROR</p>
    </body>
    </html>
    HTML;所以后来用了Header来跳转页面
      

  3.   

    $dataresult= mysql($database,"select * from $tablename where '".$username."'like '%".$password."%');直接改成:
    $dataresult= mysql($database,"select * from $tablename where username='$username' and  passwrod='$password');
      

  4.   

    这句错了
    $dataresult= mysql($database,"select * from $tablename where ".$username." like '%".$password."%');."%'); ===》 ."%'");
    少了个“"”