Web Design Forum  
 
Go Back   Web Design Forum > Web Software > Programming

Reply
 
LinkBack Thread Tools Display Modes
Old 11-15-2011, 07:52 PM   #1
New Member
 
Join Date: Nov 2011
Posts: 2
Default Image load problems

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;
schonhage is offline   Reply With Quote


Old 11-25-2011, 08:04 AM   #2
New Member
 
Join Date: Nov 2011
Posts: 2
Default

... nobody?
schonhage is offline   Reply With Quote
Old 01-06-2012, 09:05 AM   #3
New Member
 
Join Date: Jan 2012
Posts: 12
Default

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
Backseat is offline   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 06:02 PM.


Camera Forum - Computer Forum - Web Design Forum

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.
Content Relevant URLs by vBSEO 3.6.0 ©2011, Crawlability, Inc.