Avrei necessita di inserire questo blocco di codice php
Codice PHP:
<?php
$hotel=$_GET['hotel'];
include("include/config.php");
$sql = "select hotel, comune, stelle, directory, indirizzo from hotel";
$risultato = @mysql_query($sql)
or die("Impossibile eseguire l'interrogazione.");
while ($riga = mysql_fetch_array($risultato)) {
$hotel = $riga['hotel'];
$comune = $riga['comune'];
$stelle = $riga['stelle'];
$directory = $riga['directory'];
$indirizzo = $riga['indirizzo'];
$htmlhot=str_replace("HOTEL ","",$hotel);
$htmlhot=str_replace("RESIDENCE ","",$htmlhot);
$htmlhot=str_replace(" ","%20",$htmlhot);
$nomehtml=str_replace(" ","%20",$nome);
$mostra_posizione ="map.addOverlay(createMarker(new GLatLng($indirizzo), \"[b]$hotel[/b], $comune\")); ";
}
unset($sql);
?>
dentro questa parte di codice delle mappa di google (indico anche la parte dove mi server)
codice:
<script type="text/javascript">
function showMap()
{
if (GBrowserIsCompatible()) {
var map = new GMap2(document.getElementById("map"));
map.addControl(new GSmallMapControl());
map.setCenter(new GLatLng(40.727356,13.909893), 12);
function createMarker(point, description) {
var marker = new GMarker(point);
GEvent.addListener(marker, "click", function() {
marker.openInfoWindowHtml(description);
});
return marker;
}
//QUA DEVE ANDARE IL CODICE PHP PER TIRARE FUORI GLI INDIRIZZI DEGLI HOTEL
}
}
</script>
se lo incollo direttamente non va, non mi da errori ma non mi fa nessuna query.
Come posso fare?