Jump to content

Refresh Page?


New Coder

Recommended Posts

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

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

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.