Re: last updated ?
| From: | Beth Gore | Date: | Sat, 30 Nov 2002 18:14:59 +0000 |
| Subject: | Re: last updated ? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-126552@lists.php.net to get a copy of this message | ||
Paul O'Neil wrote:
Dumb question here but whats the general practice regarding putting a "website last updated:" entry on a web page? Does the web master manually enter in today's date in a database table entry and let PHP display. Is it statically added to the HTML page? Etc... I've just implimented that very thing in my site! Very simple. I have a MySQL table that features master site details, including the stylesheet, site title, that sort of thing. One column is a Datetime type.In all the admin pages that add anything new to the site, the last update time is updated using: <?php $SQL = "UPDATE site SET LastUpdate='".date("Y-m-d G:i:s")."' WHERE SiteID=1";
$result = mysql_query($SQL);?> Then, in the site's standard footer I have the following: <p class="scribbles">Last Updated: <?php
$timestamp = strtotime($sitedata["LastUpdate"]);
echo date("G:i, D \T\h\e jS of M, Y ",$timestamp);
?>
</p>
This then shows the last update time on the browser, and I also set the page to expire at that time, so in that way (I understand) browsers know if the page has been updated since you last looked.
--
Beth Gore
http://bethanoia.dyndns.org