title: Go automatically to another page using html
body: <p>I have two pages, a html that send value to a php page, and than, the php page returns the result in a div, in the html page.</p>
  
  <p>In the first test it has only a message with error, and in the else clause it must redirect to another html page, so the script in the php page will be shown in html. I've used javascript but it doesn't do it for me.</p>
  
  <p>This is all the codes that i've used:</p>
  
  <pre><code>if (mysqli_num_rows($result)==0)
  {
      echo" Code erron&amp;eacute; ";
  }
  else
  {
      header('location:infosInt.html');
      //echo "&lt;script&gt; window.open('infosInt.html')&lt;/script&gt;";
      //echo "&lt;script&gt; window.location = 'infosInt.html'&lt;/script&gt;";
  }
  </code></pre>
  
  <p><strong>EDIT</strong></p>
  
  <p>my html page :</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;head&gt;
    &lt;script type="text/javascript" src="jquery.js"&gt;&lt;/script&gt;
       &lt;script src="jquery-ui.js" charset="ISO-8859-1"&gt;&lt;/script&gt;
            &lt;script src="jquery-1.9.1.js" charset="ISO-8859-1"&gt;&lt;/script&gt;
  &lt;script  type="text/javascript" src="jquery.crypt.js" &gt;&lt;/script&gt;
     &lt;LINK rel="stylesheet" type="text/css" href="android.css"&gt;
  
    &lt;meta charset="utf-8"&gt;
    &lt;meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"&gt;
    &lt;title&gt;Login Form&lt;/title&gt;
    &lt;script&gt;
  
  function connexion(evt)
  {
  var x=document.getElementById('code');
  var cde = x.value;
   var str = $().crypt({
    method: "md5",
    source: cde
    });
  if (cde=="")
    {
   // document.getElementById("txtHint").innerHTML="";
    return;
    } 
  if (window.XMLHttpRequest)
    {// code for IE7+, Firefox, Chrome, Opera, Safari
    xmlhttp=new XMLHttpRequest();
    }
  else
    {// code for IE6, IE5
    xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
    }
  xmlhttp.onreadystatechange=function()
    {
    if (xmlhttp.readyState==4 &amp;&amp; xmlhttp.status==200)
      {
      document.getElementById("txtHint").innerHTML=xmlhttp.responseText;
      }
    }
    var url ="http://localhost/filename/page.php";
    var params="q="+ str;
          xmlhttp.open("POST",url,true);
          xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
         xmlhttp.setRequestHeader("Content-length", params.length);
         xmlhttp.setRequestHeader("Connection", "close");
  
          xmlhttp.send(params);     
  
  };
    &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
    &lt;div class="login"&gt;
        &lt;p&gt;&lt;/p&gt;
      &lt;form method="" action="" id= "codeform"  onsubmit="connexion();return false;"&gt;
       &lt;p&gt; &amp;nbsp &amp;nbsp &amp;nbsp &amp;nbsp&lt;/p&gt;
  
        &lt;input type="password"   id="code" &gt;&lt;/p&gt;
  
        &lt;p class="submit"&gt;&lt;input type="submit"  id="connect" value="Connexion" &gt;&lt;/p&gt;
  
      &lt;/form&gt;
    &lt;div id ="txtHint"&gt;&lt;/div&gt;
    &lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>and this is page.php:</p>
  
  <pre><code>&lt;?php
  
  $host     = "localhost";
  $port     = port;
  $socket   = "";
  $user     = "root";
  $password = "";
  $dbname   = "base";
  
  
  $con = new mysqli($host, $user, $password, $dbname, $port, $socket);
  if (!$con)
    {
    die('Could not connect: ' . mysqli_error($con));
    }
  
  $q =$con-&gt;real_escape_string($_POST['q']);
  
  mysqli_select_db($con,"ajax_demo");
  
  $sql="query where column ='".$q."'"; // ex
  $result = mysqli_query($con,$sql);
  
  if (mysqli_num_rows($result)==0)
    {
   echo" Code erron&amp;eacute; ";
    }
  else
  {
  echo"&lt;head&gt;&lt;meta http-equiv='refresh' content='5; URL=infosInt.html'&gt;&lt;/head&gt;";}
  
  mysqli_close($con);
  ?&gt;
  </code></pre>