title: Connect php with phonegap?
body: <p>I am making an app using phonegap and it allows .html form but we require .php format files so from will we use a server for php.<br>
  After making index.html page on phonegap, I am not getting any examples or hint to connect phonegap with php.</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
      &lt;style type="text/css"&gt;&lt;/style&gt;
      &lt;script type="text/javascript"&gt;
      function post(){
                  var first = document.getElementById("first").value; 
                  var second = document.getElementById("second").value;
  
                  var formdata = new FormData();
                  formdata.append("first", first);
                  formdata.append("second", second);
  
  
  
      var ajax = new XMLHttpRequest();
      document.getElementById('ans').innerHTML = 'Loading...';
      ajax.addEventListener("load", completeHandlerrrr, false);
  
      ajax.open("POST", "http://localhost/phonegap/app/post.php");
      ajax.send(formdata);
  }
  function completeHandlerrrr(event){
  
  var hh= event.target.responseText; 
  
      document.getElementById('ans').innerHTML = hh; 
  
  }
  
  
  &lt;/script&gt;
  
  &lt;/head&gt;
  &lt;body&gt;  
  
   &lt;input type="text" id="first" name="first" /&gt;
   &lt;input type="text" id="second" name="second" /&gt; 
   &lt;input type="submit" id="submit" name="submit" onclick="post();"/&gt;
  &lt;div id="ans"&gt;&lt;/div&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>post.php</p>
  
  <pre><code>&lt;?php
  echo $_POST['first'];
  echo $_POST['second'];
  
  ?&gt;
  </code></pre>