Thank you for your response .My english is not good but i will try to
read in english.
1. I registrer the api for http://gbsolutionsinc.net
2. I put a new page http://gbsolutionsinc.net/ProjetMap/locator.php
and i remove the / at the end.
3. header ("content-type") is early on my phpsqlsearchgen.php script
I make a test but nothing is change.
You can see my data base in this page

http://gbsolutionsinc.net/AdministratorStoreLocator/testbd3.php
Thank you very much for your help.

The code of phpsqlsearchgen.php is:
<?php
header("Content-type: text/xml");
require("phpsqlsearch_dbinfo.php");

function parseToXML($htmlStr)
{
$xmlStr=str_replace('<','&lt;',$htmlStr);
$xmlStr=str_replace('>','&gt;',$xmlStr);
$xmlStr=str_replace('"','&quot;',$xmlStr);
$xmlStr=str_replace("'",'&#39;',$xmlStr);
$xmlStr=str_replace("&",'&amp;',$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 , ( 3959 * 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_details 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_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>";





?>


On 14 jan, 00:37, Mike Williams <[email protected]> wrote:
> What's actually causing the problem is the / on the end of your URL.
>
> What happens is that when you ask for the relative URL
>   phpsqlsearchgen.php?lat=47.3902942&lng=0.6888514&radius=25
> the URL gets expanded to
>
>  http://gbsolutionsinc.net/ProjetMap/nxgooglemapsapi.php/phpsqlsearchgen
> .php?lat=47.3902942&lng=0.6888514&radius=25
>
> And that returns the HTML of your web page, whereas what you want to use
> is
>  http://gbsolutionsinc.net/ProjetMap/phpsqlsearchgen.php?lat=47.3902942&;
> lng=0.6888514&radius=25
>
> A quick and dirty fix would be to use the full URL when you fetch your
> data.
>
> A better fix would be to:
>
> 1. Register an API key forhttp://gbsolutionsinc.netrather 
> thanhttp://gbsolutionsinc.net/ProjetMap/nxgooglemapsapi.php
>
> 2. Remove the / from the end of your web page URL.
>
> 3. Add the line
>      header("Content-type: text/xml");
> early in your phpsqlsearchgen.php script so that it outputs XML rather
> than HTML.
>
> --http://econym.org.uk/gmap
> The Blackpool Community Church Javascript Team
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to