thanks for the replys, but they didnt work
devinemke - code didnt out put anything not sure why, I tried explode[0]-[6] nothing
sidney - you code seems to just load the page 🙁
site: http://daemonprojects.com/test/temp.php?zipcode=91737
heres my code so far.
<?
################
# Open Url and fetch the source From Weather.com
################
if ($_REQUEST["zipcode"] == "") {
$zipcode = "91737";
} else {
$zipcode = $_REQUEST["zipcode"];
}
$url = "http://www.w3.weather.com/weather/local/".$zipcode."?lswe=".$zipcode."&lwsa=WeatherLocalUndeclared";
$fp = fopen ($url, "r");
$re = "GET .".$url." HTTP/1.0\r\n";
$re .= "User-Agent: Mozilla/4.0 (compatible; MSIE 5.5; Windows 98)\r\n";
$re .= "Host: ".$url."\r\n";
#$re .= "Connection: Close\r\n\r\n";
fputs($fp, $re);
while (!feof ($fp)) {
$buffer = fgets($fp, 1000);
//$get_days = preg_match_all("|<[^begin loop>]+>(.*)<end loop[^>]+>|U", $buffer);
//$thebitiwant = trim(end(explode('<!-- begin loop -->',reset(explode('<!-- end loop -->',$buffer)))));
$get = strstr($buffer, 'OAS_query =');
$filter = eregi_replace("OAS_query =", "", $get);
$filter = eregi_replace("'", "", $filter);
$filter = eregi_replace(";", "", $filter);
$filter = eregi_replace(" ", "", $filter);
//printf($filter);
// Setup Varibles from string
parse_str($filter);
//echo $get_days."<Br>";
//echo $thebitiwant;
}
if ($cond == "clear_mostly_sunny") {
$get_sun = "34.gif";
} elseif ($cond == "clear_sunny") {
$get_sun = "32.gif";
} elseif ($cond == "cloud_mostly") {
$get_sun = "30.gif";
} else {
$get_sun = "11.gif";
}
?>
<title>Current Weather for <? echo $zipcode;?></title>
<body background="sun/trans.gif" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
From <a href="<? echo $url; ?>">Weather.com</a><br>
<br>
<table width="232" border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="#819DBC"><table width="100%" border="0" cellspacing="1" cellpadding="0">
<tr>
<td align="left" valign="top" bgcolor="#E3EAF0">
<table width="100%" border="0" cellspacing="3" cellpadding="0">
<tr>
<td width="48%" align="center"><img src="<? echo "sun/".$get_sun; ?>"></td>
<td width="52%" align="center"><? echo $temp; ?> °F</td>
</tr>
<tr>
<td align="center">UV Index:<br> </td>
<td align="center"><? echo $uv; ?></td>
</tr>
<tr>
<td align="center">Dew Point:</td>
<td align="center"><? echo $dew; ?> °F</td>
</tr>
<tr>
<td align="center">Humidity:</td>
<td align="center"><? echo $humid; ?> %</td>
</tr>
<tr>
<td align="center">Visibility:</td>
<td align="center"><? echo $cond; ?></td>
</tr>
<tr>
<td align="center">Wind</td>
<td align="center"><? echo $wind; ?> mph</td>
</tr>
</table>
</td>
</tr>
</table></td>
</tr>
</table>