Re: how to force a refresh?
| From: | Michael Sims | Date: | Thu, 13 Mar 2003 13:41:29 +0000 |
| Subject: | Re: how to force a refresh? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-139488@lists.php.net to get a copy of this message | ||
On Thu, 13 Mar 2003 02:25:57 -0800, you wrote:
>Ok, well I have a form that uploads images, but of course the problem is, is
>that IE caches the uploaded images. The only way to clear the cache is to
>refresh, but that isn't a very user friendly approach. I've tried the
>following header tags:
You can force a refresh of the same page by using a header redirect:
header('Location: '.$_SERVER['PHP_SELF']);
Also, if the problem is images being cached, I've seen some people use
this trick:
<img src="/path/to/image.jpg?uniq=<?=urlencode(md5(microtime()))?>">
Basically you pass a bogus URL parameter after the image name that is
different each time and this should force IE to download it again. I
haven't had a chance to try this myself, but I believe it should
work...