<?
$fp = fopen("http://www.weather.com/weather/local/" . $_GET['zip'], r);
$startpos = strpos($fp, "<B CLASS=obsTempTextA>");
$endpos = strpos($fp, "</B>", $startpos);
$temp = substr($fp, $startpos[0], $endpos[0]);
fclose($fp);
print($temp)
?>
What is wrong with this code?! I’m puzzled… no PHP error, just doesn’t print anything.
Basically the script gets the temperature from weather.com according to a zip code the user inputs…
www.weather.com/weather/local/21044
http://www.dotlall.com/weather-test.php?zip=21044
help!