Welcome to WebmasterWorld Guest from 54.145.166.247

Forum Moderators: open

Message Too Old, No Replies

Need display creation time of an image

Map updated daily, need to show time of update

   
8:37 pm on May 10, 2010 (gmt 0)

5+ Year Member



Hi,

I am a newbie to the forum, and a nevergonnabe to the world of html experts. I use an old version of Frontpage (98) to maintain our company website, and I need to show the date of an image underneath it, so that our customers know when that image was last updated. It's a map of where our trucks are available.

Our mailserver can create a text file with the date and time whenever the map is updated, if that makes the job easier.

I can't figure out a way to make this happen via any frontpage option, though I'm guessing that someone may know of a way to cause a script to do it. Any ideas?

Thanks folks,

jt
10:12 pm on May 10, 2010 (gmt 0)

5+ Year Member



If you have php enabled on your server, try this:

<?php
$myFileName = 'editPath/editFileName.jpg';
if (file_exists($myFileName)) {
echo "<h3>$myFileName was last updated on: " . date ("F d Y H:i:s.", filemtime($myFileName)) . '</h3>' ;
}
else {
echo "<h4>Oh dear... it looks like $myFileName is missing!</h4>";
}
?>
8:59 pm on May 11, 2010 (gmt 0)

5+ Year Member



I must not have php implemented. As I said, I'm not real skilled at web stuff. I tried copying and pasting your code into my html just after the image, and of course edited the path and filename to match, but it only resulted in the code itself being displayed on the page. My web page is running on an xp pro sp3 box with IIS 5.1, if that makes a difference.

Any other ideas?