PDA

View Full Version : Google Map



michael_s
12-09-2007, 08:02 AM
Sometimes fopen is not allowed on servers, you can try this instead:
$url = str_replace (" ", "%20", $url); // Leerzeichen -> %20

//BEGIN MOD
$temp="";
$a_url = parse_url($url);
$url2 = "";
if (!empty($a_url['path'])) {
$url2.=$a_url['path'];
}
if (!empty($a_url['query'])) {
$url2.="?".$a_url['query'];
}

$fp = fsockopen($a_url['host'], !isset($a_url['port']) ? 80 : $a_url['port'], $temp, $temp, 5);

if (!$fp) {
echo "ERROR"; // oder andere Ausgabe !!
} else {
fputs($fp, 'GET ' . $url2 . " HTTP/1.0rnHost: " . $a_url['host'] . "rnrn");
do {
$line = chop(fgets($fp));
} while (!empty($line) and !feof($fp));

while (!feof($fp)) {
$content = fgets($fp);
}
}

fclose($fp);
//END MOD
list($statuscode, $accuracy, $lat, $lng) = split(",", $content);

No files attached

More... (http://addons.oscommerce.com/info/5340)