title: jQuery mobile ajax login form authentication
body: <p>I know i already asked simillar question, but now when I work with jQuery Mobile I can't figure it out. So I have this form:</p>
  
  <pre><code>&lt;div data-role="page" data-theme="a" id="login_page"&gt;
          &lt;div data-role="header" data-position="fixed"&gt;
              &lt;h1&gt;****&lt;/h1&gt;
          &lt;/div&gt;
          &lt;div data-role="content"&gt;
              &lt;form id="login_form" method="POST" data-ajax="false"&gt;
              &lt;label for="basic"&gt;Username:&lt;/label&gt;
              &lt;input type="text" name="name" id="username" value=""/&gt;
              &lt;label for="basic"&gt;Password:&lt;/label&gt;
              &lt;input type="password" name="password" id="password" value=""/&gt;
              &lt;input type="submit" value="Login" id="login" name="login"/&gt;
              &lt;/form&gt;
          &lt;/div&gt;
          &lt;div data-role="footer" data-position="fixed"&gt;
              &lt;div data-role="navbar"&gt;&lt;/div&gt;
          &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>And I need to submit Username and Password to php script, where php replies and send "success" or "failed". Here is php:</p>
  
  <pre><code>&lt;?php
  session_start();
  
  $username = $_POST["name"];
  $password = $_POST["password"];
  
  include('mysql_connection.php');
  mysql_select_db("jzperson_imesUsers", $con);
  
  $res1 = mysql_query("SELECT * FROM temp_login WHERE username='$username' AND password='$password'");
  $count=mysql_num_rows($res1);
  
  if($count==1){
      echo "success";
  }else{
      echo "failed";
  }
  ?&gt;
  </code></pre>
  
  <p>And to do all this I want to use this script:</p>
  
  <pre><code>$(document).ready(function() {
          $("form").submit(function(){
              $.mobile.showPageLoadingMsg();
  
              $.ajax({
                  url: "http://imes.jzpersonal.com/login_control.php",
                  type: "POST",
                  dataType: "jsonp",
                  jsonp: "jsoncallback",
                  data: $("form#login_form").serialize(),
                  success: function( response ){
                      $.mobile.changePage( "http://imes.jzpersonal.com/user_panel.html");
                  }
              });
              return false;
          });
      });
  </code></pre>
  
  <p>But I can't make it work, I know I must have mistakes in there, I just can't find them, or better way to do it. Thank you in advance for any help.</p>