Forum Moderators: coopster

Message Too Old, No Replies

How would I make a "last updated" script?

         

electricocean

5:47 am on Mar 28, 2005 (gmt 0)

10+ Year Member



How could I make my page say: Page Last Updated: month day, year?

example:

Page Last Updated: January 1st, 2005


and would change every time the page is updated - just php, php + mysql, how would i do it?

thanks

electricocean

mincklerstraat

6:16 am on Mar 28, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you're just dealing with files you can use file modification times:
echo 'Last modified on '.date("l dS of F Y h:i:s A", filemtime($_SERVER['PHP_SELF']);
If you're dealing with mysql, I'll let another taker answer, I'm off to bed.

Prolific

7:55 am on Mar 28, 2005 (gmt 0)

10+ Year Member



You could try using SSI, for example: <!--#echo var="LAST_MODIFIED" --> should do the trick.

electricocean

1:01 am on Mar 29, 2005 (gmt 0)

10+ Year Member



wait... I am confused...

will these scripts only say "Page Last Modified:" for the ceratin page that has that script on it, or will it say the last time any part of the site was modified...?

I forgot to say that

thanks,
electricocean

coho75

1:04 am on Mar 29, 2005 (gmt 0)

10+ Year Member



It will only show the modification date of those pages that contain the piece of code found above.

electricocean

3:21 am on Mar 29, 2005 (gmt 0)

10+ Year Member



Well is there a way to to do that/