<?php
$localzone = null;
if(geoip_db_avail(1))
{
	$localzone = geoip_record_by_name($_SERVER['REMOTE_ADDR']);
}
$zip = $localzone['postal_code'];

if(!isset($zip) || $zip ==null)
{
   echo "We could not find your zip code";
   exit();
}
?>

<html>
<body>
<h1>Weather.com / GeoIP Mashup</h1>
Your zip code: <?php echo $zip; ?><br>
Your IP address: <?php echo $_SERVER['REMOTE_ADDR']; ?>
<br><br>
<a href="http://www.chrisdevbox.com/"><< Back to Chrisdevbox.com</a>
<br>
<div id="wx_module_7765">
   <a href="http://www.weather.com/weather/local/91602">North Hollywood Weather Forecast, CA (91602)</a>
</div>

<script type="text/javascript">

   /* Locations can be edited manually by updating 'wx_locID' below.  Please also update */
   /* the location name and link in the above div (wx_module) to reflect any changes made. */
   var wx_locID = '<?php echo $zip; ?>';

   /* If you are editing locations manually and are adding multiple modules to one page, each */
   /* module must have a unique div id.  Please append a unique # to the div above, as well */
   /* as the one referenced just below.  If you use the builder to create individual modules  */
   /* you will not need to edit these parameters. */
   var wx_targetDiv = 'wx_module_7765';

   /* Please do not change the configuration value [wx_config] manually - your module */
   /* will no longer function if you do.  If at any time you wish to modify this */
   /* configuration please use the graphical configuration tool found at */
   /* https://registration.weather.com/ursa/wow/step2 */
   var wx_config='SZ=300x250*WX=FHW*LNK=SSNL*UNT=F*BGI=boat*MAP=null|null*DN=chrisdevbox.com*TIER=0*PID=1064260422*MD5=aaaa88e8a973175b8ce3d06d9607de56';

   document.write('<scr'+'ipt src="'+document.location.protocol+'//wow.weather.com/weather/wow/module/'+wx_locID+'?config='+wx_config+'&proto='+document.location.protocol+'&target='+wx_targetDiv+'"></scr'+'ipt>');  
</script>
</body>
</html>