View Full Version : Auto Tag Updater
Kylegar
08-07-2007, 10:14 PM
I have a list of files that appear on my web page and I would like the update tag to be automatically updated based on the date of the file. As it stands I have to manually enter in the correct date each time the file is changed. Any ideas on how to do this?
<li><a href="literature/Phone List.xls" target="_blank" id="abc">Company Phone List</a><br>Updated July 2007 <img src='images/file_icon.gif' alt='' width='9' height='12' border='0' /></li>
<li><a href="literature/Name and Extensions List.xls" target="_blank" id="abc">Office Names & Extensions</a><br>Updated July 2007 <img src='images/file_icon.gif' alt='' width='9' height='12' border='0' /></li>
Thanks in advance
jscheuer1
08-08-2007, 02:56 AM
This cannot be done with HTML alone. Simple javascript method (just put this where you want the date to appear):
<span>Updated <script type="text/javascript">document.write(document.lastModified);</script></span>
There are all kinds of ways to make this look better on the page. One such method is laid out here:
http://www.quirksmode.org/js/lastmod.html
Also, if you have a server-side language available, it can be done with that, and then will not rely upon the user having javascript enabled.
However it is done, the date shown will be derived from the date of the file on the server. Sometimes this just isn't accurate enough due to differences in server time and the user's local time, unless some involved time conversion is made.
Kylegar
08-08-2007, 05:01 PM
I tried that but it seems to give me the date and time of the html page update not the files. My intent is that indiviuals can ftp there files into specific directories that they have access to and the update tag will automaticlly read the file date and show it on the screen. On each page there are multiple files / documents with differnet dates.
Thanks,
Brad
jscheuer1
08-09-2007, 03:38 AM
Still can't do that with HTML. I don't even think javascript will help. Both asp and PHP, and probably other server side languages can handle that task. If you don't already know, find out if you have a server side language available, and which it is if you do. Then post in a forum for that language. PHP is the only one really well supported on this board, though we do have an asp section. Codingforums.com has a more extensive selection of well populated server side language support forums. There are many other resources (forums and information) around the web for server side languages.
Kylegar
08-09-2007, 07:29 PM
Thanks i will try an asp forum.
Powered by vBulletin® Version 4.2.2 Copyright © 2021 vBulletin Solutions, Inc. All rights reserved.