I recall from long ago you could use a Front Page Extension to show the date that the page was last modified. If that possible with PHP to determine this and then "echo" the result as part of a footer document.
Thanks in advance
Date Modified
Moderator: General Moderators
Date Modified
Hardcore Games™ Legendary is the Only Way to Play™
My site is powered by LAMP
My site is powered by LAMP
Re: Date Modified
If it is a static page, you can use the filemtime function. You can even output a javascript, which renders the document.latModified property.
But if this is a dynamic script, for exampe a database driven application, you have to get the data of last entry in the database and to output it. And it's more important to send it as an HTTP header, then to output it in the footer.
But if this is a dynamic script, for exampe a database driven application, you have to get the data of last entry in the database and to output it. And it's more important to send it as an HTTP header, then to output it in the footer.
Re: Date Modified
By the way, for static pages
Code: Select all
filemtime(__FILE__) // file containing this code
filemtime($_SERVER["SCRIPT_FILENAME"]) // file originally requestedRe: Date Modified
<script type="text/javascript">
// This does not remain a constant with each refresh
var date
date=document.lastModified
document.write("Last Modified on "+date)
</script>
So I need some PHP to replace this, somebody?
The above probably is more suitable to HTML rather than PHP based ones. Have not tried that way.
// This does not remain a constant with each refresh
var date
date=document.lastModified
document.write("Last Modified on "+date)
</script>
So I need some PHP to replace this, somebody?
The above probably is more suitable to HTML rather than PHP based ones. Have not tried that way.
Hardcore Games™ Legendary is the Only Way to Play™
My site is powered by LAMP
My site is powered by LAMP
Re: Date Modified
Found something after sifting through some crud.
This works fine, which is what my goal was.
Code: Select all
<?php
// outputs e.g. 'Last modified: March 04 1998 20:43:59.'
echo "Last modified: " . date ("F d Y H:i:s.", getlastmod());
?>
Hardcore Games™ Legendary is the Only Way to Play™
My site is powered by LAMP
My site is powered by LAMP