i am storing the files on the server so that they can be recalled when the email is sent out with the images held within it. the reason i want to add the random number after they have been stored is because the images are being cached.
the problem with the images getting cached is if the user comes and uploads a new image with the same file extension it will only show the cached version of the image. i have tried to stop the images getting cached with various different methods which in clude php headers and html meta tags, both methods failed.
so my next attempt at trying to get it show the new images is by adding a random number. if i store the number with the file i have no way of knowing the full path to the file once a random number has been added to it.
i tried a method were the random number that was generated was sent to the other pages with the session_start() function but that through up a load of errors with my code that is working fine without that in.
if i can get it to find the image without the random number attached to it then add this i am hoping this will stop the old images from being displayed on the pages. I know it is a problem with the images being cached because each time the upload page is entered it unlinks the last file that was uploaded.
hope that makes it a bit more clear.