I'm new to Jquery, and I'm trying to create a login page, using JQuery and PHP but it doesn't respond when I click the login button, what I want is that after the login is success it redirect to index.html.

here is the JQuery code : 

```
<script type="text/javascript" > 
$(document).ready(function() {
  $("form#memberlogin").submit(function(e) {
      dataString = $(this).serialize();
      $.post("check_login.php", dataString, function(data) {
          $('form#memberlogin').hide();
          window.location="index.html"
      });
      e.preventDefault(); 
  });
});
</script>

```

Here is my form code : 

```
<form id="memberlogin" class="form-horizontal"  method="post">
                    <fieldset>
                        <div class="input-prepend" title="Username" data-rel="tooltip">
                            <span class="add-on"><i class="icon-user"></i></span><input id="username" autofocus class="input-large span10" name="username" id="username" type="text" value="admin" />
                        </div>
                        <div class="clearfix"></div>

                        <div class="input-prepend" title="Password" data-rel="tooltip">
                            <span class="add-on"><i class="icon-lock"></i></span><input id="password" class="input-large span10" name="password" id="password" type="password" value="admin123456" />
                        </div>
                        <div class="clearfix"></div>

                        <div class="input-prepend">
                        <label class="remember" for="remember"><input type="checkbox" id="remember" />Remember me</label>
                        </div>
                        <div class="clearfix"></div>

                        <p class="center span5">
                        <button type="submit" class="btn btn-primary">Login</button>
                        </p>
                    </fieldset>
                </form>

```

And this is my php code : 

```
 <?php
 ob_start();
 $con=mysql_connect(localhost,"root","-----");
 if(!con)
 {
  die(mysql_error());
  exit();
 }

 mysql_select_db("sure") or die(mysql_error());

  $user=$_POST['username'];
  $pass=$_POST['password'];

if(get_magic_quotes_gpc()){
  $user = stripslashes($user);  //mencegah mysql injection
  $pass = stripslashes($pass);
}
  $user = mysql_real_escape_string($user);
  $pass = mysql_real_escape_string($pass);

  $result=mysql_query("SELECT * FROM user WHERE username='$user' and password='$pass'") or  die(mysql_error());
  $count=mysql_num_rows($result);
  if($count==1)
  {
    session_register("user");
    session_register("pass");
    $_SESSION['username']=$_POST['user'];
    $_SESSION['id']=mysql_result($result,0,'id');

    echo 'correct';
    header("location:index.html");
  }
  else
  {
    die("id atau password anda salah");
    exit();
  }

  mysql_close($con);
   ob_end_flush();
 ?>

```