check if page was redirected or opened directly in php
<p>Can I check if <code>page2.php</code> was opened directly or I was redirected from <code>page1.php</code> </p>

<p>I tried with <code>if(!header_sent()){}</code> but it didn't work.</p>

<p>please can anyone help me? thank you</p>
