 |
| PHP How-To Post your "How do I do this with PHP?" questions here. |
Welcome to the p2p.wrox.com Forums.
You are currently viewing the PHP How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|
|

June 21st, 2004, 06:30 AM
|
|
Friend of Wrox
|
|
Join Date: Nov 2003
Posts: 1,285
Thanks: 0
Thanked 2 Times in 2 Posts
|
|
Rich,
I am not trying to say you didn't know that. I'm just trying to point out that, if this person's problem can only be solved by clearing out the cache in IE, do all IE users have to clear out the cache when they encounter this?
I was directing the comment more toward matd, although now I see that I did not make that very clear.
|
|

June 21st, 2004, 06:42 AM
|
|
Friend of Wrox
|
|
Join Date: Jun 2003
Posts: 256
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Well, there's alwyas the brutal hack approach...
<img src="/path/image.ext?foo="<?php echo md5(time()); ?>"...
Your users won't usually get to see what's in the src attribute of your images, and IE will rerequest the file, as I say, because the src has changed.
Take it easy
Dan
|
|

June 21st, 2004, 07:14 AM
|
|
Registered User
|
|
Join Date: Jun 2004
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
tried the hack approach appending a random number onto the image url and also tried creating a show_image.php page to use as the <img src> to header the location image url as i thought that might help but neither work.
|
|

June 21st, 2004, 01:40 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
|
|
Here's the thing:
Quote:
quote:
I am not trying to say you didn't know that. I'm just trying to point out that, if this person's problem can only be solved by clearing out the cache in IE, do all IE users have to clear out the cache when they encounter this?
|
I suggested that he clear the cache before implementing the hacks to be sure that the images weren't being pulled from the cache. The user's wouldn't have to do this. As on first run, the image wouldn't already be in the cache, as could have been the case here.
IE 6 is an out-of-date, horribly standards incompliant browser. Just try to delve a little into CSS 2 and you'll know what I'm talking about. My suggesting that he use Mozilla has nothing to do with his designing for one audience or another. That is purely propoganda. Screw the populous. See there, that tidbit is more propoganda.
That said, since you're just pulling an image from the file system, I would concur then with Dan's brutal hack as the best approach.
Regards,
Rich
::::::::::::::::::::::::::::::::::::::::::
The Spicy Peanut Project
http://www.spicypeanut.net
::::::::::::::::::::::::::::::::::::::::::
|
|

June 21st, 2004, 02:26 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 1,706
Thanks: 0
Thanked 6 Times in 6 Posts
|
|
Quote:
quote:Originally posted by matd
tried the hack approach appending a random number onto the image url and also tried creating a show_image.php page to use as the <img src> to header the location image url as i thought that might help but neither work.
|
At this point, then, it would be helpful if you provide some code so that we can recreate the problem. Also, what version of IE are you using?
Regards,
Rich
::::::::::::::::::::::::::::::::::::::::::
The Spicy Peanut Project
http://www.spicypeanut.net
::::::::::::::::::::::::::::::::::::::::::
|
|

January 21st, 2005, 04:15 PM
|
|
Registered User
|
|
Join Date: Sep 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Passing through, but wanted to thank you for the information provided.
I am capturing img's through forms. Browsers used the cache version when returned to input form. adding the md5 time stamp is what fixed it, i.e. <img src="<?print $p['pictureb'] ?>?fool=<? print md5(time()) ?>"
Thank you !!!
Kit
|
|

June 10th, 2006, 03:32 AM
|
|
Registered User
|
|
Join Date: Jun 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Thanks to all who've contributed to this thread! Been looking for a clean, consistant solution to the image cache/update problem for months where especially Internet Explorer 6 has proven the most difficult. My situation is complicated by the fact that i let my users design graphics using php gd on the fly, so everything is dynamic. In addition i create a list of graphics that have allready been created and display them in a list using a scrolling <iframe> on the same page-- sort of like a graphic shopping cart. My users can select an image from the list and edit/correct it, but after they submit the changed image no amount of meta no-cache, expire time, refreshes, you name it, would provide a consistant display of the updated image across browsers. I was at my wits end, the client was pissed, i was pissed and then i happened on this simple, beautiful and fully functional solution: by just appending ?fool=<?php print md5(time()); ?> to the image name in the img tag, the normal order of my world was restored and all was good again...;)) Now, on to cross-browser css inconsistancies...lol
Again, thanks!
|
|
 |