scusami, ma forse non mi sono spiegato.....
i tuoi post andrebbero bene se, dovessi stampare, in php, invece, devo passare la variabile all'interno di un javascript...
posto il codice:
codice:
//nella pagina read.php
$query = ("SELECT location_id, quartiere, lat, lng, img FROM locations") or die ("Non è possibile eseguire la Select " . mysql_error());
if($txtQuartiere!=""){
$query .= " where quartiere = '" . $txtQuartiere . "'";
//echo "sono dentro quartiere";
}
$query = mysql_query($query);
echo "<locations>";
while ($row=mysql_fetch_assoc($query)){
echo '<location location_id="'.$row['location_id'].'" quartiere="'.$row['quartiere'].'" lat="'.$row['lat'].'" lng="'.$row['lng'].'" img="'.$row['img'].'"/>';
}
echo "</locations>";
//nella index.html che ha il javascript
function onLoad() {
var urlstr="Geo/Testmap1/read.php";
map = new GMap(document.getElementById("div_map"));
map.setCenter(new GLatLng(getAttribute("lat"),getAttribute("lng")), 14);
getMarkers();
GEvent.addListener(map, "click", function(overlay, point) {
if (overlay){ // marker clicked
overlay.openInfoWindowHtml(overlay.InfoWindow);// open InfoWindow
} else if (point) { // background clicked
}
});
}
in pratica al posto di getAttribute("lat") e di getAttribute("lng")
dovrebbero esserci le variabili ( i valori) estrapolati dal db e passati da read.php
Spero ora sia più chiaro...grazie mille...