Ok, basic idea of the script:
I have a webcam that uploads an image to a server. The camera only uploads if motion is detected.
I attempted to write a script to tell me when the image was last updated. BUT, I want it to compare to another time that I have documented in "time.txt"
BUT, the script says that the time is not the same regardless...
Anyways, without further a due, heres the script.
<?php
$your_data = date("m/d/y H:i:s", filemtime("image.jpg"));
$myFile = "time.txt";
$fh = fopen($myFile, 'r');
$theData = fread($fh, filesize($myFile));
fclose($myfile);
if ($your_data == $theData) {
print "<img src='image.jpg'><br>File has not been updated <br>$your_data<br>$theData";
} else {
print "THE IMAGE IS CURRENTLY UP-TO-DATE<br>This means that the broadcasted image is up-to-date with the indexed image based on a script that stores the image's last modified time in a txt file.<br> It is compared with the current modified time of the actual image.<br><br> and this is your_data: <b>$your_data</b><br>and this is theData: <b>$theData</b>";
}
?>
However, regardless if $your_data equals $theData, it always outputs the else statement.
Here's the output of the page, as you can see the variables are the same:
THE IMAGE IS CURRENTLY UP-TO-DATE
This means that the broadcasted image is up-to-date with the indexed image based on a script that stores the image's last modified time in a txt file.
It is compared with the current modified time of the actual image.
and this is your_data: 12/09/08 08:44:45
and this is theData: 12/09/08 08:44:45
Any Ideas?