Image load problems

schonhage

New Member
Hey all,

I'm a beginning PHP-using webdesigner, and me and my partner almost finished our first site.

But we just stumbled upon a little problem. We have a gallery with multiple pages and of course multiple photos per page. It all seemed to be running fine until we noticed the pictures don't change when you change pages. They only appear when you refresh a couple of times - or a couple of hundred times.

Now I know the images are just 'stuck' in cache and that you can easily solve it with session_destroy(); session_start();, but here's my problem.

In order to view the photos, you have to be logged in. Adding a session restarter to the gallery causes you to log out again, thus disabling you to view the images.

So, how do I solve this problem? Is there a way to refresh the images without logging out, or is there another way to remember that the user is logged in?

The code I used for the login is $_SESSION['logged_in'] = true;
 

Backseat

New Member
Well there's some things you can do

for starters, make sure every image has a different name. If you change the image, don't save it with the same name. That way it won't be in the browser cache.

Also, the problem might not be in the browser cache. Check the source code of the generated HTML (ctrl+u in most browsers). Maybe your page switching mechanism is busted. Also, to eliminate browsercache problems, try using firefox or google chrome and simply explicitely clear your cache (or use ctrl+F5, does the trick in 99% of the cases if you're not talking about HTML5 offline caching)

Once you've established the problem is in the browser cache, the "saving with a different name" thing is your only option, I think. If you've established the problem is in the PHP code, update your post with that information or make a new thread
 
Top