thebadbad Posted November 23, 2008 Share Posted November 23, 2008 I haven't looked through all your code, but why not simply check if the image exists, before displaying it? <?php $path = "http://localhost/pas/upload/$file1name"; if (file_exists($path)) { echo '<img src="', $path, '" alt="" />; } else { //image doesn't exist } ?> You'll maybe need to run clearstatcache() before checking. Or simply don't display the image HTML tag when, when a user have chosen to delete the image? Then it can't show up no matter if it exists or not. Quote Link to comment Share on other sites More sharing options...
gsaldutti Posted November 23, 2008 Author Share Posted November 23, 2008 That is a definitely a good idea for my code, thanks. But in IE, it's still happening where I remove IMAGE-A and add IMAGE-B and it still displays IMAGE-A. Mindboggling. I assume clearstatcache() just needs to be at the top of the page one, but I tried it in seveal places throughout the code. Dropfaith mentioned that it could just be a funny thing that is happening on my local machine and once I upload the site to a public server it might work fine. If you think that is possibility, can someone help tell me how to get the GD library installed/enabled on a server so I can test this on my "live" site (or is that something my hosting company has to do?) Quote Link to comment Share on other sites More sharing options...
thebadbad Posted November 23, 2008 Share Posted November 23, 2008 But in IE, it's still happening where I remove IMAGE-A and add IMAGE-B and it still displays IMAGE-A. Mindboggling. That would only happen when the filenames of the images are identical, right? Naming them differently should stop IE from showing the cached image A. If the live server is not your own, you should ask your hosting company politely about adding GD lib. Quote Link to comment 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.