Hi there,
I have a PHP script that uploads photo onto the server and then displays the photo for you. You can also overwrite an uploaded photo with a new photo if you wish.
My problem is, when I've uploaded a new photo, which overwrites the old photo, it displays the old photo ("on the your photo has upload" page) until you refresh the page... So I'm guessing it saves the old photo in the cache until you refresh the page...
Is there anyway I can force the browser to show the new photo and not the old photo without reloading the page?
Uploaded photos and cache problem...
Moderator: General Moderators
if it is the cache, then
Code: Select all
header("Cache-Control: no-cache, must-revalidate");yes you can do it , cheat the browser by sending a random string in querystring with image file name ..
here you go;
enough cheating with browser 
here you go;
Code: Select all
<?php
strRand = uniqid(rand());
?>
<IMG SRC="image.png?<?=strRand?>">