Website Hosting and Development

Friday, August 11, 2006

Display when page has been updated

It is a good idea to show when a webpage has been last updated. By doing this, your visitors will get the idea on how often new content is added to your website and will want to come back. You can accomplish this by adding a following JavaScript code in your webpage code:

< script language="Javascript" &#62
document.write("This page was last modified on: " + document.lastModified +"");
< /script &#62


Instead of JavaScript you can use php code below to accomplish same result:

<?
header("
This page was last modified on: " . gmdate("D, d M Y H:i:s",
filemtime($SCRIPT_FILENAME)) . " GMT");
?>




Cheers, Marin
Check for more articles on this topic at Website Hosting and Development website.

You can also visit DIMM Info Systems Inc. website to see how else I can help you achive your goals.

0 Comments:

Post a Comment

<< Home