0

Currently working on a project that requires the following:

I have this page, and I wanna make sure the contents cannot be seen unless the visitor is coming from a pre-defined URL.

I know that can be easily accomplished via $_SERVER['HTTP_REFERER'], but the URL that will precede the actual page is only an automated header() redirector, and not an actual page, that contains a clickable link for the users to click on and get redirected.

$_SERVER['HTTP_REFERER'] does not seem to work for an automated redirect.

How should I address this issue?

Mirian
  • 9
  • 7
  • may this link will help you:- http://stackoverflow.com/questions/12369615/serverhttp-referer-missing – Ravi Hirani Jan 07 '16 at 10:32
  • Thank you. I forgot to mention, that the redirect and the actual target page are gonna be located on different servers, so I cannot just set a session and use it to authenticate the user so they can see the page only if they've visited the redirector first. – Mirian Jan 07 '16 at 10:34
  • See here: http://stackoverflow.com/questions/1969709/how-to-forward-headers-on-http-redirect – yergo Jan 07 '16 at 10:36
  • Try this tutorial:- http://www.plus2net.com/php_tutorial/php_referrer.php – Ravi Hirani Jan 07 '16 at 10:39
  • I figured it out - I can simply use a redirect instead, and the $_SERVER['HTTP_REFERER'] is preserved successfully. If I use a header() redirect, it's omitted. Thank you for the help! – Mirian Jan 07 '16 at 10:50

0 Answers0