New Coder Posted February 21, 2007 Share Posted February 21, 2007 Hello all, Is there a way that I can get a page to refresh it's information if navigated to from another page using the refresh button. For instance: A user is viewing page 1, they navigate to page 2, they return to page 1 by preesing the back button. Can page 1 then refresh itself just incase the details have changed since last viewing? Many thanks Link to comment https://forums.phpfreaks.com/topic/39471-refresh-page/ Share on other sites More sharing options...
camdagr81 Posted February 21, 2007 Share Posted February 21, 2007 You could of course use $_SERVER['HTTP_REFERER'] and try to come up with a statement that would determine if the user was coming from a page that is ahead of the current page in the site map. <?php $ref = $_SERVER['HTTP_REFERER']; if (preg_match('/page2.php/i', $ref)) { header("Location: page1.php"); } ?> Link to comment https://forums.phpfreaks.com/topic/39471-refresh-page/#findComment-190445 Share on other sites More sharing options...
hvle Posted February 21, 2007 Share Posted February 21, 2007 A user is viewing page 1, they navigate to page 2, they return to page 1 by preesing the back button. Can page 1 then refresh itself just incase the details have changed since last viewing? Interesting question! I think this is a browser problem, and since it is browser, you can not achieve this any how. As my understanding of course. Maybe someone else have diff idea. Anyway, you can set a refresh timer or something say 10 seconds and browser will refresh itself if updated information. Link to comment https://forums.phpfreaks.com/topic/39471-refresh-page/#findComment-190455 Share on other sites More sharing options...
Jessica Posted February 21, 2007 Share Posted February 21, 2007 Add no-cache headers to the pages. Link to comment https://forums.phpfreaks.com/topic/39471-refresh-page/#findComment-190465 Share on other sites More sharing options...
New Coder Posted February 22, 2007 Author Share Posted February 22, 2007 Ok thanks, I will give the no-cache headers a try and will let you know how I get on. Many Thanks Link to comment https://forums.phpfreaks.com/topic/39471-refresh-page/#findComment-191189 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.