Woody’s PHP Scripts

PHP is a server-side, cross-platform, HTML embedded scripting language. (If you know JavaScript, you're ready for PHP.) PHP is very similar to Microsoft’s ASP. And in some ways, PHP (and I assume ASP) are easier to apply then cgi. To learn about PHP, visit PHP Builder or PHP.net.

I wrote the following script to learn PHP and also to learn how to decode a weather METAR observation statement.

Please feel free to use, copy and/or modify this script for your needs. I have posted this script for people to use and to learn from.

GetWX - see demo1, demo2, demo3, or see script    (February, 2001)

The NWS post hourly weather information from airports around the world in a weather observation statement called a METAR. Given a four-letter station code, the weather data from any station can be decoded. This script reads a METAR file from the NWS server and decodes it into usable information. The script is well documented and should be easy to modify for metric units or incorporated into a more presentable web page.

Get Weekly Advent or Christmas Image - see script    (December, 2006)

This function returns an xhtml image tag of a different icon for each week of Advent, or a single icon during the twelve days of Christmas. All dates needed are automatically calculated for the current Advent and Christmas season. (Need four different images for Advent plus an image for Christmas.)

Capitalize - see script    (June, 2003)

This function capitalizes the words in a title according to the MLA Handbook, that is, no articles, prepositions, and conjunctions are capitalized. (I also added any forms of the verb ‘to be’.)

dir - see enhanced demo, plain demo, or see script    (July, 2002)

The purpose for this script is to replace the directory listing provided by the server if no index page is present. This php script will list only filenames with certain extensions, i.e. .html, .php, .css, etc. The list of viewable extensions is easy to edit within the script. No folders or sub-directories are listed, nor is any file named “index”. The idea of this script is to renamed it as index.php, and placed in the directory you want to limit the information of the types of files.