How to display a 'modified on' date with php
Posted: Thu Nov 16, 2006 5:14 pm
/*************************************
Title:gbook
Version:1.43
Author:
Demo:
Download:
Website:http://www.gilsbus.ca
Short description: Slightly off-topic - displaying a 'modified on' date
*************************************/
I incorporated the guest book into my web-site
http://www.gilsbus.ca, Thank you.
In the footer of all pages on my site, I use the following javascript line to display the date/time that the file was created-
<script type="text/javascript">
document.writeln("Page updated - " + document.lastModified);</script>
On the guestbook pages rendered by PHP, this script will ALWAYS show that the file is newly created.
Is there a code I can include in footer.txt, or inside gbook.php itself which would display the 'modified on' date of the original gbook.php file and have it update automatically only when the original file is altered/amended?
To be consistent with the rest of my site, I would appreciate a solution which allows the code to be added to footer.txt.
My options as I see them
1. Discontinue all date/time references - delete code from footer.txt
2. Manually enter a date into the footer.txt file - Will not automatically update if file altered.
3. Get help from the forum to provide a workable solution. I consider myself a newbie to php.
Thanks in advance for your help.
Title:gbook
Version:1.43
Author:
Demo:
Download:
Website:http://www.gilsbus.ca
Short description: Slightly off-topic - displaying a 'modified on' date
*************************************/
I incorporated the guest book into my web-site
http://www.gilsbus.ca, Thank you.
In the footer of all pages on my site, I use the following javascript line to display the date/time that the file was created-
<script type="text/javascript">
document.writeln("Page updated - " + document.lastModified);</script>
On the guestbook pages rendered by PHP, this script will ALWAYS show that the file is newly created.
Is there a code I can include in footer.txt, or inside gbook.php itself which would display the 'modified on' date of the original gbook.php file and have it update automatically only when the original file is altered/amended?
To be consistent with the rest of my site, I would appreciate a solution which allows the code to be added to footer.txt.
My options as I see them
1. Discontinue all date/time references - delete code from footer.txt
2. Manually enter a date into the footer.txt file - Will not automatically update if file altered.
3. Get help from the forum to provide a workable solution. I consider myself a newbie to php.
Thanks in advance for your help.