Jump to content

page refresh issue


mb

Recommended Posts

I have an issue with refreshing pages on the website. I have a simple code using php to login to the website fill in a form and exit. The code works fine and adds the enterd data correctly in the table in MySql. I have another link where the user can retrieve the recods to update any fields after logging in. The problem I encountered was that the retreving records page does not show the newly added records until the page is refreshed on the server. Whenever the new record does not show, I just open the php code page save without making any changes to the code (just to enforce new time stamp), upload the page to the server only when I do that the new record shows.

I would appreciate any help to solve this problem and not having to upload the page to get it to work.

 

Thanks,

MB

Link to comment
Share on other sites

The problem I encountered was that the retreving records page does not show the newly added records until the page is refreshed on the server. Whenever the new record does not show, I just open the php code page save without making any changes to the code (just to enforce new time stamp), upload the page to the server only when I do that the new record shows.

 

That sounds like your browser is caching the results. The new timestamp maybe allowing another download.

What happens if you load the page in the browser with a different GET value each time? e.g.

yourlink.com/index.php?stopcache=1

yourlink.com/index.php?stopcache=2 , etc

 

In theory that should prevent caching, as each load has a unique URL. It's a primitive method, but suitable for testing purposes.

Link to comment
Share on other sites

Thank you Simon for the reply! It worked when I used a random # in the GET value!

It seems to me that it is a caching issue with the host company as clearing my browser cache and history was not helping. In addition the problem was there even when testing on other computers.

Is there a way to enforce caching on the server?

 

Thanks,

MB

Link to comment
Share on other sites

DO NOT rely on meta tags to send the user to a new URL. Besides, that doesn't solve the problem at hand: caching.

 

You could try sending additional header() info to prevent caching. Here is some info, though not tested (by me):

 

http://www.blog.highub.com/php/php-solutions/php-prevent-browser-and-proxy-cache/

 

OR you could keep the random GET value in the URL to

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.