if($_SERVER['REQUEST_METHOD'] == "POST")
{
  $Username = $_POST['Username'];
  $Userpass = $_POST['Userpass'];
  $sql = "SELECT Userpass FROM `user` WHERE Username = '$Username'";
$chk = mysql_query($sql,$connect);
$query = mysql_fetch_array($chk);
if( $query[0] == $Userpass )
{
echo "<html>
      <head>
      <meta http-equiv='refresh' content='5'; url='$url'>
      </head>
      <body>
         <center><table>
          <tr>
            <td>登陆成功!</td>
          </tr>
          <tr>
            <td><a href='index.php'>等待5秒跳转到首页,或者直接点这里返回</a></td>
          </tr>
      </table></center>
      </body>
      </html>";
}

else
{

echo "<html>
      <head>
      <meta http-equiv='refresh' content='5'; url='$url'>
      </head>
      <body>
          <center><table>
          <tr>
            <td>用户名或者密码错误!</td>
          </tr>
          <tr>
            <td><a href='index.php'>等待5秒跳转到首页,或者直接点这里返回</a></td>
          </tr>
      </table></center>
      </body>
      </html>";

}