1

I have a mini gallery I created and what I did was just used FTP, no database so when I upload a photo it is named "image1.jpg" and then if I upload another image it is named "image2.jpg" and so on. Well, if I delete image1, then image2 is automatically renamed to image1.jpg and all of them get re-named if there are more.

The problem is that now the new image1 is showing the old image unless I clear my cache. I found a mini solution to work around this:

$rand = rand(100,1000);
<img src="images/image1.jpg?<?=$rand;?>">

That works fine but I found that it does not work with facebox, whenever I try to view the full-size image in Facebox, it can't read the URL with the random number and it just brings up a ton of characters that usually crashes my browser.

Is there a better way to fix this?

4

1 回答 1

1

您不能在图像目录上放置任何缓存标头。

于 2011-06-22T21:22:00.267 回答