Last Updated script

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • kustomguitarist
    New Member
    • Nov 2006
    • 9

    #1

    Last Updated script

    I'm working on updating a page for a club that I'm involved in at school. It's on an apache server and I am editing the .htm file through linux.

    Does anyone know a script that I could include in the html file that would display the Time and Date that the .htm file was last updated?

    Thanks!

    I tried the following two things that I found online but neither seemed to work.


    (JavaScript)

    <SCRIPT LANGUAGE="JavaS cript">
    <!-- hide script begin var m = "Page updated" + document.lastMo dified; var p = .length-8;
    document.writel n("<center>") ;
    document.write( m.substring(p, 0));
    document.writel n("</center>");
    // End --> </SCRIPT>


    (PHP)

    <?
    $last_modified = filemtime("exam ple7.php3");
    print("Last Modified ");
    print(date("m/j/y h:i", $last_modified) );
    ?>
  • kustomguitarist
    New Member
    • Nov 2006
    • 9

    #2
    figured it out.... here it is if anyone else is wondering


    <script language="JavaS cript">
    <!--//
    document.write( "<i>"+"Last Updated -"
    +document.lastM odified + "</i>");
    //-->
    </script>

    Comment

    • baddco
      New Member
      • Jul 2007
      • 1

      #3
      I'm interested in a twist on this. I like the updated script, But can I make the results of one pages update appear on another? Example: I'm working on a site for a photographer, instead of updates appearing only on the page that was updated, could they also appear on the main page of the site?

      Comment

      • drhowarddrfine
        Recognized Expert Expert
        • Sep 2006
        • 7434

        #4
        Yes but you need to ask on the javascript forum.

        Comment

        Working...