Any way to identify the F5 update in PHP?

Is there a way to determine if someone has updated the current page using PHP, and not arrived from another place.

I only have access to the code for the current page, so I can’t transfer anything from the page elsewhere for verification.

+3
source share
4 answers

The title of your question suggests that you are looking for a way to detect when a page is being refreshed using the F5 key. If in this case you definitely need JavaScript to determine if a key has been pressed. If you would still like to refresh the page, then the answer should help: fooobar.com/questions/1280316 / ... . It takes into account the full URL, as well as the contents of any form.

+6
source

Add an event unload()that either sets a cookie or starts a PHP session through AJAX. Then, when the page is loaded, check the cookie or session - if it is present even recently, the user has just updated.

+3
source

, .

PHP $_SERVER HTTP_REFERER. , - ( - ) , , ..; ( ). F5 ( . , f5).

JavaScript . , .

. F5-. close/open, reopen link .. , URI.

+3

F5 . :

, :

  • URL (. ). , ,
  • URL- , LAST_VIEWED_PAGE
+2

All Articles