Location: PHPKode > scripts > MyWeather > my_weather_v1.2/index.php
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<style type="text/css">*{font-family:verdana,arial,sans-serif;font-size:10pt}</style>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<title>MyWeather</title>
</head>
<body>
<div>
<?php if(!isset($_GET['zip'])) { ?>
	<form method="get" action=""><div>
		Enter a Zip Code: <input name="zip" size="5"/><br/>
		Units: <label><input type="radio" name="u" value="f" checked="checked"/> Farenheit</label>
		<label><input type="radio" name="u" value="c"/> Celsius</label><br/>
  		<input type="submit" value="Submit"/>
	</div></form>
<?php
}
else {
	include('weather.class.php');
	$ret = weather($_GET['zip'], ($_GET['u'] == 'c'));
	echo "<table cellpadding=\"2\" cellspacing=\"4\">\n";
	echo "\t<tr><td colspan=\"3\"><strong>".$ret[0]['location']."</strong></td></tr>\n";
	foreach($ret as $day) {
		echo "\t<tr><td>".$day['when'].'</td><td><img src="i/'.$day['image'].'"/></td><td>'.$day['text'].'<br/>';
		if(isset($day['temp'])) {
			echo $day['temp'].', Windchill: '.$day['windchill'].'<br/>';
			echo 'Wind: '.$day['wind'].'<br/>';
			echo 'Humidity: '.$day['humidity'].'<br/>';
			echo 'Visibility: '.$day['visibility'].'<br/>';
			echo 'Preasure: '.$day['preasure'].'<br/>';
			echo 'Sunrise: '.$day['sunrise'].'<br/>';
			echo 'Sunset: '.$day['sunset'];
		}
		else echo 'Hi: '.$day['high'].', Low: '.$day['low'];
		echo "</td></tr>\n";
	}
	echo "</table>\n";
}
?>
</div>
</body>
</html>
Return current item: MyWeather