Can I check if page2.php was opened directly or I was redirected from page1.php
I tried with if(!header_sent()){} but it didn’t work.
please can anyone help me? thank you
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.
Create a Session variable when a user visits page1.php, then on page2.php check if that session variable exists. If so, then the user was redirected from page1.php.
page1.php:
page2.php:
Obviously, this method is assuming that you’re only dealing with these two pages…
Hope this helps