Is there any way to identify whether someone has refreshed the current page using PHP rather than arriving from elsewhere.
I have access only to the code for the current page so I can’t pass anything from the page elsewhere to check against.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The title of your question suggests that you’re specifically looking for a way to detect when a page is refreshed using the F5 key. If that’s the case, you’ll definitely need JavaScript to detect if the key was pressed. If you don’t care how the page was refreshed, then this answer should help: https://stackoverflow.com/a/456915/1144176. It takes into account the full URL as well as any form content.