<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[come prendere un campo javascript e passarlo a una variabile php]]></title><description><![CDATA[<p dir="auto">salve ragazzi ho il seguente codice:</p>
<pre><code>&lt;html&gt;
&lt;head&gt;
  &lt;script type="text/javascript" src="htt p: / / w w w .google.com/jsapi?key=INSERIRE_QUI_LA_API_KEY"&gt;&lt;/script&gt;
  &lt;script&gt;
  google.load("maps", "2");

  function initialize() {
    //Valori de default
    var zoom = 3;
    var latlng = new google.maps.LatLng(37.4419, -100.1419);
    var location = "Sto visualizzando la posizione di default";

    //Se ClientLocation è valorizzato allora prendo i valori della posizione attuale
    if (google.loader.ClientLocation) {
      zoom = 13;
      latlng = new google.maps.LatLng(google.loader.ClientLocation.latitude, google.loader.ClientLocation.longitude);
      location = "Visualizzo la posizione trovata in base all'IP: &lt;b&gt;" + getFormattedLocation() + "&lt;/b&gt;. Lat: "+google.loader.ClientLocation.latitude+", Long: "+google.loader.ClientLocation.longitude;
	  
    } 
   
    document.getElementById("location").innerHTML = location;
    var map = new google.maps.Map2(document.getElementById('map'));
    map.setCenter(latlng, zoom);
    map.addControl(new GLargeMapControl());
    map.addControl(new GMapTypeControl());
	
	//Aggiungo segnaposto
    map.addOverlay(new GMarker(latlng));
  }

   //Posizione trovata scritta con città e stato	
  function getFormattedLocation() {
    if (google.loader.ClientLocation.address.country_code == "US" &amp;&amp;
      google.loader.ClientLocation.address.region) {
      return google.loader.ClientLocation.address.city + ", " 
          + google.loader.ClientLocation.address.region.toUpperCase();
    } else {
      return  google.loader.ClientLocation.address.city + ", "
          + google.loader.ClientLocation.address.country_code;
    }
  }
  
  google.setOnLoadCallback(initialize);
&lt;/script&gt;


&lt;/head&gt;
&lt;body&gt;
&lt;div style="width:500;height:300" id="map"&gt;&lt;/div&gt;
&lt;div id="location"&gt;&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>
<p dir="auto">come faccio a passare a una variabile ip il seguente valore?</p>
<p dir="auto">location = "Visualizzo la posizione trovata in base all'IP: &lt;b&gt;" + getFormattedLocation() + "&lt;/b&gt;. Lat: "+google.loader.ClientLocation.latitude+", Long: "+google.loader.ClientLocation.longitude;</p>
<p dir="auto">graZIE</p>
]]></description><link>https://dev.connect.gt/topic/139420/come-prendere-un-campo-javascript-e-passarlo-a-una-variabile-php</link><generator>RSS for Node</generator><lastBuildDate>Thu, 26 Nov 2026 06:32:08 GMT</lastBuildDate><atom:link href="https://dev.connect.gt/topic/139420.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 18 Nov 2010 12:41:20 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to come prendere un campo javascript e passarlo a una variabile php on Thu, 02 Dec 2010 13:04:20 GMT]]></title><description><![CDATA[<p dir="auto">Devi farlo in un'altra pagina, perché il PHP viene eseguito prima del Javascript, quindi non puoi ritornare a PHP una variabile Javascript.</p>
]]></description><link>https://dev.connect.gt/post/950824</link><guid isPermaLink="true">https://dev.connect.gt/post/950824</guid><dc:creator><![CDATA[alcatraz]]></dc:creator><pubDate>Thu, 02 Dec 2010 13:04:20 GMT</pubDate></item></channel></rss>