Hi,
Please, i need your help.
I have a problem with my google map. It is not run and i don't know
why. This is my url : http://www.towtab.com/test2/locatorstore_bis.php
.
My file for genrate xml is
<?php
header("Content-type: text/xml");
require("geocode_dbinfo.php");
function parseToXML($htmlStr)
{
$xmlStr=str_replace('<','<',$htmlStr);
$xmlStr=str_replace('>','>',$xmlStr);
$xmlStr=str_replace('"','"',$xmlStr);
$xmlStr=str_replace("'",''',$xmlStr);
$xmlStr=str_replace("&",'&',$xmlStr);
$xmlStr=str_replace("é",'é',$xmlStr);
$xmlStr=str_replace("è",'è',$xmlStr);
return $xmlStr;
}
// Get parameters from URL. les variables globales ont été remplies
par l'internaute.
$center_lat = $_GET["lat"];
$center_lng = $_GET["lng"];
$radius = $_GET["radius"];
// Start XML file, create parent node
//$dom = new DOMDocument("1.0");
//$node = $dom->createElement("markers");
//$parnode = $dom->appendChild($node);
// Opens a connection to a MySQL server
$connection=mysql_connect ($server, $username, $password);
if (!$connection) {
die('Not connected : ' . mysql_error());
}
// Set the active MySQL database
$db_selected = mysql_select_db($database, $connection);
if (!$db_selected) {
die ('Can\'t use db : ' . mysql_error());
}
// Select all the rows in suppliers_details table
$query = sprintf("SELECT suppliers_address , suppliers_latitude ,
suppliers_longitude , suppliers_city , suppliers_name, ( 6371 * acos
( cos( radians('%s') ) * cos( radians( suppliers_latitude ) ) * cos
( radians( suppliers_longitude ) - radians('%s') ) + sin( radians
('%s') ) * sin( radians( suppliers_latitude ) ) ) ) AS distance FROM
suppliers_info HAVING distance < '%s' ORDER BY distance LIMIT 0 , 20",
mysql_real_escape_string($center_lat),
mysql_real_escape_string($center_lng),
mysql_real_escape_string($center_lat),
mysql_real_escape_string($radius));
$result = mysql_query($query);
//if (!$result) {
//die('invalid query: ' . mysql_error());
//}
// Start XML file, echo parent node
echo "\n<markers>\n";
//Iterate through the rows, printing XML nodes for each
while ($row = @mysql_fetch_assoc($result)){
// ADD TO XML DOCUMENT NODE
echo '<marker ';
echo 'name="' . parseToXML($row['suppliers_name']) . '" ';
echo 'city="' . parseToXML($row['suppliers_city']) . '" ';
echo 'address="' . parseToXML($row['suppliers_address']) . '" ';
echo 'lat="' . $row['suppliers_latitude'] .'" ';
echo 'lng="' . $row['suppliers_longitude'] .'" ' ;
echo 'distance="' . $row['distance'] . '" ';
echo "/>\n";
}
// End XML file
echo "</markers>";
?>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Maps API" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/Google-Maps-API?hl=en
-~----------~----~----~----~------~----~------~--~---