Hello, I have reciently swapped web hosting companies and therefor i am now using PHP5. One of my pages needs to be reloaded if the back button is used to return to it, i used to use the code: header("Cache-Control: no-store, no-cache, must-revalidate"); header("Cache-Control: post-check=0, pre-check=0", false); but this does not seem to work any more. Can anyone help? Late
Could you please create a phpinfo file and then PM me the URL, you might have missing apache modules that are needed, you old host must have had them but your new host doesn't.
man i hate it when sites take away the functionality of the back button. It's awful design when you need to take away browser functions. Its also a sign that the site is awful, to have to implement code to try and keep a user on it.
That's not what i'm asking i dont want a page to cache, i want the page to reload if a user returns to it.
No problem, i completely agree with you, there is nothing worse than going to a page from google and then not being able to use the back button to get back to your Google results. Late
You could probs get around it using this cheeky code..? <?php session_start(); if($_SESSION['views'] < 1) { $_SESSION['views'] = 1; ?><META HTTP-EQUIV=Refresh CONTENT="0"><?php } session_destroy(); ?> PHP: That way, each time the page is viewed, it is refreshed. A bit of a nasty work around. You could just put the session_destroy() in other pages. I dunno - i will try and look for something better.. lol
AS you always destroy the session, it's the same as writing in the HTML: <META HTTP-EQUIV=Refresh CONTENT="0">
what the? what... a... noob! I can't believe it. I've obviously been working too hard. lol alcuadrado is right, ignore my post. lol- im so embarassed. I was modifying a code for functionality similar, but got lost along the way. I apologise.
I found this article just now (posted on november 7th 2007). Maybe it will help? http://www.sitepoint.com/article/caching-php-performance Let me know
after back button try to press f5 or refresh, back button still executes sesion_start(); ive tried history +1 on js, just a cheat, that forces the cookies to reload the recent page..