| | |
adding random number
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
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.
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.
Last edited by kevin wood; May 12th, 2008 at 10:59 am.
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.
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.
![]() |
Similar Threads
- Help needed filling array with unique random numbers (C++)
- C++ Random Numbers (C++)
- Random number generator freezing (VB.NET)
- A new question about adding and subtracting (Visual Basic 4 / 5 / 6)
- Random Double Generation With Precision? (C)
- Adding Random Numbers help (C++)
- Random number generator (Java)
- How to put the random integer between 1-100 into the 2 dimensions array (5x5 metrix) (C++)
- Adding RAM to HP Pavillion 8776C - odd problems? (Motherboards, CPUs and RAM)
Other Threads in the PHP Forum
- Previous Thread: set data to be value of variable
- Next Thread: Need Code help to open new tab
| Thread Tools | Search this Thread |
Tag cloud for PHP
.htaccess access ajax apache api array autosuggest beginner binary broken cakephp checkbox class cms code cron curl database date directory display download dynamic echo email emptydisplayvalue eregi error explodefunction file files folder form forms function functions google hack href htaccess html image include insert integration ip java javasciptvalidation javascript joomla keywords limit link login loop mail matching menu mlm mod_rewrite multiple mysql oop parse paypal pdf php problem query radio random recursion regex remote script search searchbox server sessions sms soap source space sql structure syntax system table tutorial update upload url validation validator variable video web website xml youtube






