Code: Seeing if an image has been updated.
Moderator: General Moderators
Code: Seeing if an image has been updated.
revised
Last edited by andrewmg on Mon Dec 08, 2008 6:46 pm, edited 1 time in total.
Re: Code: Seeing if an image has been updated.
revision, I fixed the resource, but I'm now getting a seperate problem.
now it outputs the same thing, even if they file has not updated.
Code: Select all
<?php
$imagefile = "image.jpg";
$your_data = date("m/d/y H:i:s", filemtime("image.jpg"));
$myFile = "time.txt";
$fh = fopen($myFile, 'r');
$theData = fread($fh, filesize($myFile));
if ($your_data == $theData) {
echo "<img src='image.jpg'><br>File has not been updated <br>$your_data<br>$theData";
}
if ($your_data != $theData) {
echo "<img src='image.jpg'><br>File has been updated, <br>$your_data<br>$theData<br>";
}
?>now it outputs the same thing, even if they file has not updated.
File has been updated,
12/07/08 11:03:13
12/07/08 11:03:13