Quick question here. I wanted a way to quickly change the URL of an image that is place on my page, so I came up with the following little script:
<?php
echo "Status: $status";
if ($status == 'Online'){
rename('status.bmp', 'offline.bmp');
rename('online.bmp', 'status.bmp');
}
elseif ($status == 'Offline'){
rename('status.bmp', 'online.bmp');
rename('offline.bmp', 'status.bmp');
}
echo "<meta HTTP-EQUIV=\"REFRESH\" content=\"0; url=status.htm\">";
?>
I pass the $status variable from a link before this page.
It works the first time. Actually it works all the time, but after the first time, the old image is left in the users temp directory, so the image doesn't change until they delete it from their temporary internet files. In firefox, it works ok if you just refresh the page, but in IE, it doesn't work until you delete the temp files. is there another way i can go about this?
Let's assume that I can't change the code on the page that is calling the image. That's why I need to change the name of the file on the server.
Thanks.