title: How I can to pass the values lat, lng and address from jQuery function to PHP form, and save all on a table MySQL?
body: <p>How I can to pass the values lat, lng and address  from  jQuery google maps functions (gmaps.js) to main.html ?  . I want to obtain these values  and with others  - that I will get in the main html, I want to write all together on a table (markers)   of MySQL, with a save button.
  Any idea? 
  Thank you!!</p>
  
  <p>//**gmaps.js  function</p>
  
  <pre><code>function update_ui( address, latLng ) {
    $('#gmaps-input-address').autocomplete("close");
    $('#gmaps-input-address').val(address);
    $('#gmaps-output-latitude').html(latLng.lat());
    $('#gmaps-output-longitude').html(latLng.lng());
    $('#gmaps-output-address').html(address);
    }
  </code></pre>
  
  <p>//**html main code:</p>
  
  <pre><code>&lt;div id='input'&gt;
        &lt;input type='text' id='gmaps-input-address' placeholder='to start, write address...'  size="41" /&gt;
        &lt;div id='gmaps-error'&gt;
       &lt;/div&gt;
  &lt;/div&gt;
      &lt;div id="gmaps-canvas" style="width:auto; height:250px"&gt;&lt;/div&gt;
        &lt;p&gt;
  &lt;!—show current lat, lng and address   --&gt;
        Latitude: &lt;span id='gmaps-output-latitude'&gt;&lt;/span&gt; &lt;br/&gt;
        Longitude: &lt;span id='gmaps-output-longitude'&gt;&lt;/span&gt;&lt;br/&gt;
        Address: &lt;span id='gmaps-output-address'&gt;&lt;/span&gt;&lt;br/&gt;
  ……
  ……
  &lt;!—start form. (get others values)   --&gt;
  
      &lt;label&gt;name&lt;br /&gt;
      &lt;input class="text" type="text" name="name" id="name" width="100%"/&gt;
      &lt;/label&gt;
  
      &lt;label&gt;address&lt;br /&gt;
      &lt;input class="text" type="text" name="address" id="precio" width="100%"/&gt;
      &lt;/label&gt;
      …… 
    &lt;!—here I need to get lat and assign to var--&gt;
    &lt;!—here I need to get lng and assign to var --&gt;
    &lt;!—here I need to get address and assign to var --&gt;
    &lt;!— each one lat, lng , address,  in separate vars --&gt;
    &lt;!— call to sql to save them in a table --&gt;
  &lt;!—end of form (get others values)    --&gt;
  </code></pre>
  
  <p>//**SQL sentence:</p>
  
  <pre><code>function insertar($campos){
  
  if($this-&gt;con-&gt;conectar()==true){
  return mysql_query("INSERT INTO markers ( name, precio, lat, lng, address ) VALUES ('".$campos[0]."','".$campos[1]."','".$campos[2]."','".$campos[3]."','".$campos[4]."')");
          }
      }
  </code></pre>