Results 1 to 5 of 5

Thread: Auto Tag Updater

  1. #1
    Join Date
    Jun 2007
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Auto Tag Updater

    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 &nbsp;<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 &nbsp;<img src='images/file_icon.gif' alt='' width='9' height='12' border='0' /></li>

    Thanks in advance

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    This cannot be done with HTML alone. Simple javascript method (just put this where you want the date to appear):

    Code:
    <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.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Jun 2007
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    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

  4. #4
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    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.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  5. #5
    Join Date
    Jun 2007
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Thumbs up thanks

    Thanks i will try an asp forum.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •