Your Ad Here

 Navigation
Home
Source code
Tutorials
RSS feeds
Articles
Wordpress plugins
Blog
Books
Software
Downloads
Hosting
manuals
Script directory
Training
Our Links




 Sponsors
 Links
golfing products
finance products
gambling sites
 Downloads
 Misc
Webmaster Resources
Only PHP
ScriptSearch.com
Scripts.com - Get the best scripts NOW!
AndreaPHP Programming

Valid XHTML 1.0 Transitional


Valid CSS!


Displaying the weather


Displaying the weather

This example will display the weather depending on either what US zip code or city is entered . An improved example would allow the users to enter this information via a form . All of this is freely available at http://www.weather.com .

Code :

<?
//insert a valid US zipcode in here e.g 22222 or you can enter a city
$zipcode = 55555;
//make our url
$url = "http://www.weather.com/weather/local/".$zipcode."?y=16&x=11";
//open the $url for reading
$fp = fopen($url, "r");
$search = fread($fp, 64000);
//close the file handle
fclose($fp);
//our start point and end points , store the rest in $content
$search = ereg("<!-- end svr wx alert -->(.*)<!-- 10 day forecast -->", $search, $content);
//display content
echo "$content[1]";
?>




Books
 Sponsors
 Random Code
Generate a random password(randomizing)
Display the dimensions of an image(image)
File size function(file system)
 Random Article
  Network
Programming resources
Tutorials directory
Clickbank mall
sell software
Free auctions, low cost stores
UK products
US products
Gambling directory
Sexy free wallpapers
Hosting resources
ASP site
DVD site
Domain names
Dating site
Software directory
Maxi directory
bigarticle : free articles




beginners PHP Copyright © 2004 onwards by beginnersPHP.