This is my first post and I know very little about PHP, so please bear with me. What I'd like to do is read a directory of text files and based on the filenames, output the result to an HTML table. This directory is updated with files all the time, so that's why I'm wanting to use PHP. Here's a bit more of details.
I have an EMWIN weather server running on my Windows box. It uploads specified text files to a directory on my web server. The basic filename structure is 3 letters for the product name followed by the NWS 3 letter identifier. For example: AFDILX.txt would be Area Forecast Discussion from the Lincoln, IL NWS office. There may also be a file called AFDLOT.txt which would be the Area Forecast Discussion from Chicago NWS office.
What I'm wanting the PHP script to do is read through all the filenames in the directory and then based on the available files, output to an HTML table listing the timestamp from the file and then based on the first three letters of the file name, spell out the product description. For example: if the file name is AFDILX, it would automatically put Area Forecast Discussion into the table. If the file name is TORILX, it would put Tornado Warning into the table. Also included in the table will be a link to that file so you can click on it and then it'll display the file.
So pulling these 2 files from the directory, the table will look something like this:
AFDILX.txt will yield the following row:
Area Forecast Discussion / Lincoln NWS / 9-21-03 @ 4:10pm / Link to file
TORILX.txt will yield a similar row:
Tornado Warning / Lincoln NWS / 9-21-03 @ 4:10pm / Link to file
Eventually I'd like to be able to sort the higher priority files like the warnings and watches to the top of the page, but have no idea how to do that. I'd also like to be able to color code each type of product. That is, the tornado warnings would be red, severe warnings orange, etc...
Am I trying to do too much here, or is this something fairly simple to do? A similar example of what I'd like to do is located on the College of DuPage site:
http://kamala.cod.edu/il/
That's kinda what I'd like to do, but of course they won't share their coding with me. (which is totally understandable!) Any help would greatly be appreciated. Here's a link to the directory I'm trying to get all this done with:
http://www.stansweather.net/emwin/
Thanks to all who can help.
-Stan