i am using php to upload images onto the server and then they are being displayed on other pages around the site. the problem i am having is if the user changes the images that they have uploaded the old ones are displaying from the cache.

i would like to know if it is possible to get the image from the server and then add a random number to it so that the cached images will always have a different number appended to the end of the file when of the image when displayed.

i dont want the random number stored with the file i only want it to be used when the file is being displayed.

i have tried to store the image with the random number and then post the variable holding this number to other pages from the image upload form but this has not worked. the variable is not getting posted so i can only get the rest of the file name when i look at the image properties.

Recommended Answers

All 3 Replies

that is sort of what i have working now but the problem with this method is that i am storing my images on the server and for me to be able to display the image again i must know what the appended number will be for me to be able to display the image again.

if it was possible to store the image like myimage.gif and when it came to display the image then have it as myimage.gif.1234 so that when the image was cached i it should be cahced with the number attached to it.

the more i think about it and the more i research it the more i am starting to thing that this will not work.

i am storing the number in a mysql db and then getting the number out of the db and appending it to the image on the different pages the images are used.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.