title: Pass Data from form 1 to form 2 but redirect form 1 to form 3 using php
body: <p>It may seems strange but I possible don't know how to get it done. To explain it more, here's my dilemma. I have a page which I named form1.php (just for testing) which has an input textbox and an input submit type which is eclosed in a form which will redirect to form4.html (this is HTML).</p>
  
  <p><strong>Here's the code for form 1</strong></p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
        &lt;meta charset="utf-8"&gt;
        &lt;title&gt;Testing of GPS&lt;/title&gt;
        &lt;link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css"&gt;
        &lt;script src="//code.jquery.com/jquery-1.10.2.js"&gt;&lt;/script&gt;
        &lt;script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"&gt;&lt;/script&gt;
        &lt;link rel="stylesheet" href="/resources/demos/style.css"&gt;
        &lt;script&gt;
        $(function() {
          $( ".datepicker" ).datepicker();
        });
        &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;center&gt;
          &lt;form action="form4.html" method="POST" name="manualform"&gt;
              &lt;div style="border:solid;background:#B29393;height:50%;width:50%;margin-top:150px;"&gt;
                  &lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;&lt;br/&gt;
                  Mobile Number:&lt;input type="text" name="platemobnum" id="platemobnum"/&gt;
                  &lt;br/&gt;&lt;br/&gt;
                  From:&lt;input type="text" class="datepicker" id="from" name="from"&gt;
                  &lt;br/&gt;&lt;br/&gt;
                  &lt;input type="submit"&gt;
              &lt;/div&gt;
          &lt;/form&gt;
      &lt;/center&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p></p>
  
  <p>Now, I want the value of my data in this form (form1.php) to be posted not it form4.html but in form2.php but the form1.php must redirect to form4.html.</p>
  
  <p><strong>Here's the form2.php</strong></p>
  
  <pre><code>&lt;?php
  
  try {
  
      $db = new PDO($dsn, $username, $password);
      $db-&gt;setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );
  
      $sth = $db-&gt;query("SELECT * FROM locations where name = '$platemobnum' ");
      $locations = $sth-&gt;fetchAll();
  
  
  } catch (Exception $e) {
      echo $e-&gt;getMessage();
  }
  </code></pre>
  
  <p><strong>Here's my form 4</strong></p>
  
  <pre><code>&lt;script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"&gt;&lt;/script&gt;
      &lt;script type="text/javascript"&gt;
      //&lt;![CDATA[
  
      var map;
  
      // Ban Jelačić Square - Center of Zagreb, Croatia
      var center = new google.maps.LatLng(14.641667, 121.084167);
  
      var geocoder = new google.maps.Geocoder();
      var infowindow = new google.maps.InfoWindow();
  
  
      function init() {
  
          var mapOptions = {
              zoom: 13,
              center: center,
              mapTypeId: google.maps.MapTypeId.ROADMAP
          }
  
          map = new google.maps.Map(document.getElementById("map_canvas"), mapOptions);
  
  
          var marker = new google.maps.Marker({
              map: map, 
              position: center,
          });
  
           makeRequest('get_locations.php', function(data) {
  
              var data = JSON.parse(data.responseText);
              var bounds = new google.maps.LatLngBounds();
              for (var i = 0; i &lt; data.length; i++) {
                  displayLocation(data[i]);
              }
          });
           bounds.extend(myLatLng);
          // window.alert(infowindow);
      }
      map.fitBounds(bounds);
      function makeRequest(url, callback) {
          var request;
          if (window.XMLHttpRequest) {
              request = new XMLHttpRequest(); // IE7+, Firefox, Chrome, Opera, Safari
          } else {
              request = new ActiveXObject("Microsoft.XMLHTTP"); // IE6, IE5
          }
          request.onreadystatechange = function() {
              if (request.readyState == 4 &amp;&amp; request.status == 200) {
                  callback(request);
              }
          }
          request.open("GET", url, true);
          request.send();
      }
  
  
  
  
      function displayLocation(location) {
  
          var content =   '&lt;div class="infoWindow"&gt;&lt;strong&gt;'  + location.name + '&lt;/strong&gt;'
                          + '&lt;br/&gt;'     + location.address
                          + '&lt;br/&gt;'     + location.description + '&lt;/div&gt;';
  
          if (parseInt(location.lat) == 0) {
              geocoder.geocode( { 'address': location.address }, function(results, status) {
                  if (status == google.maps.GeocoderStatus.OK) {
  
                      var marker = new google.maps.Marker({
                          map: map, 
                          position: results[0].geometry.location,
                          title: location.name
                      });
  
                      google.maps.event.addListener(marker, 'click', function() {
                          infowindow.setContent(content);
                          infowindow.open(map,marker);
                      });
                  }
  
              });
          } else {
              var position = new google.maps.LatLng(parseFloat(location.lat), parseFloat(location.lon));
              var marker = new google.maps.Marker({
                  map: map, 
                  position: position,
                  title: location.name
              });
  
              google.maps.event.addListener(marker, 'click', function() {
                  infowindow.setContent(content);
                  infowindow.open(map,marker);
              });
  
          }
  
      }
  
  
  
      &lt;/script&gt;
  &lt;/head&gt;
  &lt;body onload="init();"&gt;
  
      &lt;h1&gt;LTFRB Monitoring System&lt;/h1&gt;
  
      &lt;section id="sidebar"&gt;
          &lt;div id="directions_panel"&gt;&lt;/div&gt;
      &lt;/section&gt;
  
      &lt;section id="main"&gt;
          &lt;div id="map_canvas" style="width: 70%; height: 500px;"&gt;&lt;/div&gt;
      &lt;/section&gt;
  
  &lt;/body&gt;
  </code></pre>
  
  <p></p>
  
  <p>Is it possible and Ik would like to thank anyone for your advance help/.</p>