title: Jquery Mobile - form submission - Error Loading Page
body: <p>I submit a form like so:</p>
  
  <pre><code>&lt;form action="userlogin.html" method="get" name="log_form" onsubmit="return form_val();"&gt;
  </code></pre>
  
  <p>which is all good, then it goes to produce the cookie if log in data correct as follow:</p>
  
  <pre><code>if ($email){ // 111
      require '/php/lib/dbconnect.inc';
      $email=strtolower($email);
      $password=strtolower($password);
      $result = mysql_query("SELECT name from users where (username = '$email' AND password = '$password')",$db); 
      if(!$result) { echo mysql_error(); exit; } // debug
      $item = mysql_fetch_row($result);
      $result_userid = mysql_query("SELECT user_id from users where (username = '$username' AND password = '$password')",$db); 
      if(!$result_userid) { echo mysql_error(); exit; } // debug
      $item_userid = mysql_fetch_row($result_userid);
      if ('0'==$item[0]){ // 33
      $error .= "You typed the wrong email address or password, please check the information entered.&lt;br&gt;&lt;br&gt;&lt;br&gt;";
      } // close 33
      else { // 44
      require '/php/lib/setup.inc';
      $user = Encrypt_data ($item_userid[0]);
      setcookie("user_cook", "$user", 0);
      header("Location: /en/");
      } // close 44
      } // close 111
  </code></pre>
  
  <p>But I always get "error loading page" whether data input is correct or not, therefore something is not right but what?</p>
  
  <p>Also, I have tried adding my header include file into this so therefore passing the jQuery Mobile tags before assessing if the data is correct which does work but then of course I cannot use <code>header("Location: /en/");</code></p>
  
  <p>So I guess to clarify, this all works OK and the form is passing the data but it seems as if jQuery needs something before it will look at other data... the following works:</p>
  
  <pre><code>if ($email){ // 111
      include '/home/twovo77/1NTJ3EJZ/php/nav/mobile_header.inc';
      // require '/home/twovo77/1NTJ3EJZ/php/lib/dbconnect.inc';
      $email=strtolower($email);
      $password=strtolower($password);
  </code></pre>
  
  <p>but is no good as its passing to the header</p>
  
  <p>mobile_header.inc is:</p>
  
  <pre><code>&lt;? 
  require '/php/lib/setup.inc';
  require '/php/lib/dbconnect.inc'; ?&gt;
  
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; 
  &lt;html&gt; 
  
  &lt;head&gt;
  &lt;meta charset="utf-8"&gt;
  &lt;meta name="viewport" content='width=device-width, initial-scale=1.0, maximum-        scale=1.0, min-width=321px'&gt;
  &lt;link rel="stylesheet" href="mobile.css" /&gt;
  
  &lt;script src="http://code.jquery.com/jquery-1.6.4.min.js"&gt;&lt;/script&gt;
  &lt;script src="http://code.jquery.com/mobile/1.0rc2/jquery.mobile-.0rc2.min.js"&gt;
  &lt;/script&gt;
  
  &lt;/head&gt; 
  
  &lt;body&gt; 
  
  &lt;div data-role="page" id="foo" data-title="&lt;? echo $page_title; ?&gt;"&gt;
  
  &lt;a href="index.html"&gt;&lt;div data-role="header" data-theme="c" style="height:50px; padding:3px;"&gt;&lt;img src="/images/logo2.png"&gt;&lt;/div&gt;&lt;/a&gt;&lt;!-- /header --&gt;
  
  &lt;? echo $header_image; ?&gt;
  
  &lt;div data-role="content"&gt;&lt;div class="inner"&gt;
  </code></pre>
  
  <p>So is there some tag in there that has to be passed otherwise you get error loading page</p>
  
  <p>or, more importantly, can i bypass this while i execute my log in code then go back to it...if so, how?</p>