webguync Posted December 30, 2010 Share Posted December 30, 2010 I have a small script on the bottom of all my pages on my site which list the date and time the page was modified. I want to make the script an include and just put that on the page, but as it is now scripted that won't work since you have to change the page name for every page. Is there a way to change this so it can be an include? $last_modified = filemtime("pagename.php"); print("Last Modified "); print(date("m/j/y h:i", $last_modified));?> Link to comment https://forums.phpfreaks.com/topic/223019-a-better-way-to-do-date-modified-script/ Share on other sites More sharing options...
mikecampbell Posted December 30, 2010 Share Posted December 30, 2010 $last_modified = filemtime($_SERVER['SCRIPT_FILENAME']); Link to comment https://forums.phpfreaks.com/topic/223019-a-better-way-to-do-date-modified-script/#findComment-1153074 Share on other sites More sharing options...
webguync Posted December 30, 2010 Author Share Posted December 30, 2010 awesome thanks! Link to comment https://forums.phpfreaks.com/topic/223019-a-better-way-to-do-date-modified-script/#findComment-1153078 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.