User:Alex1337
<?php
if ($_GET("q")== 'box'){ $min_lon = $_GET["min_lon"]; $min_lon = $_GET["min_lat"]; $min_lon = $_GET["max_lon"]; $min_lon = $_GET["max_lon"];
$ch = curl_init();
curl_setopt($ch, CURLOPT_PROXY, "http://martin.rt-labor.it.fh-worms.de"); curl_setopt($ch, CURLOPT_PROXYPORT, 3128); curl_setopt($ch, CURLOPT_URL, "http://api06.dev.openstreetmap.org/api/0.6/map=bbox=".$min_lon.",".$min_lat.",".$max_lon .","$max_lat); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPGET, true);
$response = curl_exec($ch);
if(curl_getinfo($ch,CURLINFO_HTTP_CODE) == 404){ header("HTTP/1.0 404 Not Found"); return; } header ("Content-Type: text/xml"); echo $response; curl_close($ch); return; }
if ($_GET["q"] == 'way'){ if ($_GET["id"]==){ header("HTTP/1.0 401 BAD REQUEST"); return; } $id = $_GET["id"]; $ch = curl_init(); curl_setopt($ch, CURLOPT_PROXY, "http://martin.rt-labor.it.fh-worms.de"); curl_setopt($ch, CURLOPT_PROXYPORT, 3128); curl_setopt($ch, CURLOPT_URL, "http://api06.dev.openstreetmap.org/api/0.6/way/".$id."/history"); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPGET, true);
$response = curl_exec($ch); if (curl_getinfo($ch,CURLINFO_HTTP_CODE) == 404){ header("HTTP/1.0 404 Not Found"); return; } header ("Content-Type: text/xml"); echo $response; curl_close($ch); return; }
} ?>