News Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

CSS-Tricks.com:
Using Weather Data to Change Your Website's Appearance through PHP and CSS
February 18, 2009 @ 12:08:03

On the CSS-Tricks.com site today there's a quick tutorial on changing up the look and feel of your site based on an external source. More specifically, they give the example of updating the graphics of your site depending on the weather in your area via PHP and CSS.

Using a little magic and trickery (read: PHP and CSS), we can change the appearance of a website automatically based on the weather outside, in real time! In the example site we have created, the header graphic will change to one of four different styles based on Sunny, Rain, Snow, and Cloudy.

Their example makes a request to the Yahoo! weather data for a location and brings it in to PHP where the XML is parsed (via a regular expression) and the current conditions are parsed out. This condition is then passed out into the page as the class type on the header and, based on the CSS already defined, the correct image is pulled in as the background.

0 comments voice your opinion now!
weather data yahoo change header css graphic external source


blog comments powered by Disqus

Similar Posts

DevShed: Handling Entries for a Blogger Built with PHP

Elizabeth Smith's Blog: Fun with compiling - Gtk+, PHP-Gtk2, and MSVC

Stuart Herbert's Blog: Introducing ContractLib (Programming Contracts)

Jani Hartikainen's Blog: Decoupling models from the database: Data Access Object pattern in PHP

Pierre-Alain Joye's Blog: Filter 0.10.0 released


Community Events





Don't see your event here?
Let us know!


list language laravel tips framework api introduction install library release symfony community deployment podcast voicesoftheelephpant bugfix opinion package interview series

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework