Ahhh, now thats refreshing!
August 9, 2007 11:11 AM
Subscribe
How do I make sure a page loads with a fresh copy and not from the users cache?
I am working on a small site. It is basically just a single message board. The page has a form where people can enter some text and their name and hit submit. Below the form is the message list.
The form sends its data to a PHP script which cleans the text a bit and then adds it to a MySQL DB. It then uses a "Location: 'main.php'" command to go back to the main page. The main page with the form is just a short PHP script that queries the DB and displays all the results.
The problem is, on some computers (my work computer for instance) after adding a message using the form, when it sends them to the main page it shows a cached copy of the main page, and so their message isnt visible. Hitting "refresh" will reload the page and their message is then visible.
How do I go about forcing the page to "refresh" every time it is vistited, or at the very least, after the form has been submitted? Any help you guys can provide would be most appreciated!
posted by LoopyG to computers & internet (7 comments total)
3 users marked this as a favorite
posted by hattifattener at 11:18 AM on August 9, 2007