script to check and download a file if newer or changed
I'd like to do this automatically, but will settle for a manual "check for updates" submit button approach
The site has a "picture of the day" which is usually, but not always, changed daily. The web page is close to a full screen display of that picture.
If a user clicks on "check for updates" and there are none (ie the picture on the site is the same as the picture in their cache), then there should be no refresh. It seems to me that it should be possible just to check the file size and ?date of the pic on the server and compare it to the same details of the file in the cache, and only initiate a download if the server side file is newer.
and another solution is to use the md5_file() function to set a cookie on the user's computer and then when they goto the image page md5_file() the file on the server with the md5_file() value in the user's cookie and if they are the same..... you cant really just load it from the user's computer this way though.. you could put "you have already seen this picture would you like to re-download it?" ensted of the picture and then when it said that it would link to "picoftheday.php?v=1" or something and then it would show the picture no matter what...