PDA

View Full Version : HOW TO auto read files and regenarate table in dreamweaver?



BLopes
Oct 22nd, 2008, 12:51 PM
I there.
I'm trying to buid a page that once selected an item from a list, auto-reads files in a folder and and sort them in a table, with a calendar look.
The files are being feed to the folder with the name "ZON YY-MM-DD.gif" "PSI20 YY-MM-DD.gif" "JMAR YY-MM-DD.gif"
i.e.

"MONDAY" | "TUESDAY" | "WEDNESDAY" | "THURSDAY" | "FRIDAY" |
--------------------------------------------------------------------
YY-MM-DD | YY-MM-DD | YY-MM-DD | YY-MM-DD | YY-MM-DD |
....
....
....
--------------------------------------------------------------------
08-10-20 | 08-10-21 | 08-10-22 | 08-10-23 | 08-10-24 |
--------------------------------------------------------------------
08-10-13 | 08-10-14 | 08-10-15 | 08-10-15 | 08-10-16 |
--------------------------------------------------------------------

Until now for each week I was coding in manually the new row for each item, but it's a pain changing the date and item.

<tr>
<td><div align="center">07-07-2008</div></td>
<td><div align="center">08-07-2008</div></td>
<td><div align="center">09-07-2008</div></td>
<td><div align="center">10-07-2008</div></td>
<td><div align="center">11-07-2008</div></td>
</tr>
<tr>
<td><div align="center">
<p><img src="ZON 08-07-08.gif" width="220" height="129" /></p>
</div></td>
<td><div align="center">
<p><img src="ZON 08-07-08.gif" width="220" height="129" /></p>
</div></td>
<td><div align="center">
<p><img src="ZON 09-07-08.gif" width="220" height="129" /></p>
</div></td>
<td><div align="center">
<p><img src="ZON 10-07-08.gif" width="220" height="129" /></p>
</div></td>
<td><div align="center">
<p><img src="ZON 11-07-08.gif" width="220" height="129" /></p>
</div></td>
</tr>

How can I do this automatically?
Doing it with FOR's WHILE's and IF's seems very troublesome.

Any code or pointers are welcome.

BLopes

BLopes
Oct 22nd, 2008, 05:03 PM
What if I chose to order it my creation date or modification date?
How can i do this?

_Aerospace_Eng_
Oct 22nd, 2008, 05:09 PM
HTML alone cannot do this. You will need a server side language like php, asp, or jsp to read the directories. Then it would be just a matter of storing the file names in an array and sorting that. After sorted you would use a for loop to output the data. Again none of this would be done with just HTML. A server side language would be used.