I am having a problem and cannot figure out why the values of two vairables are not being passed to a function to retrieve a map for a foreign city and country
it shows this error:
which returns the longitude and latitude for the vaule of rome, italy
but when i cut and paste the URL from that error into the browser, the HTTP request works:
[url]http://site.mysite..com/spmp/MPClient?type=poi&SRC=sp&input=rome&country=italy[/url]
Latitude = 41893327, Longitude = 12500916, error = 2, address_show = Rome, Lazio, Italy
here is that function:
function get_map($S, $T){
$coordinates = file_get_contents('http://site.mysite..com/spmp/MPClient?type=poi&SRC=sp&input=' . strtolower(urlencode($T)) . '&country=' . strtolower(urlencode($S)));
preg_match("/Latitude = (.*?), Longitude = (.*?),/is", $coordinates, $matches);
$latitude = $matches[1];
$longitude = $matches[2];
$image_width = 200;
$image_height = 250;
$image_location = file_get_contents("http://site.mysite..com:9080/spmp/MPClient?type=worldurl&SRC=sp&width=$image_width&height=$image_height&x=$longitude&y=$latitude&level=9&cust_x=$longitude&cust_y=$latitude&poi=My+Place");
$image_location = str_replace('url = ', '', $image_location);
return $image_location;
}
not sure what I am doing wrong, any help would be appreciated
thanks in advance
Mike