php_guy Posted August 13, 2007 Share Posted August 13, 2007 Hello all, Is there a way to force the user's browser to refresh an image on every visit to the page? (regardless of their Internet settings or cache settings)? E.g. I have a page that links an image (via IMG SRC tag) but this image is updated every once in awhile. I want the user's browser to always have the latest copy of it when they visit the page Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/64674-refreshing-an-image/ Share on other sites More sharing options...
calabiyau Posted August 13, 2007 Share Posted August 13, 2007 I'm trying to remember but it goes something like this. you append a ?var=some_random_number to the image src <img src="yourpic.jpg?time=<?php echo time(); ?>"/> Should force the browser to get the newest image Quote Link to comment https://forums.phpfreaks.com/topic/64674-refreshing-an-image/#findComment-322474 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.