0

I have a page called snow.php. I want to disable people from being able to see my webpage if they type in www.mysite.com/snow.php unless they are linked from another page. So if I have another page called about.php and link to snow.php they'll be able to see it.

AlexL
  • 1,699
  • 12
  • 20
  • Why do you want to do this? It seems like a bizarre feature to want. One approach might be to only serve the page if the request contains a referer header (note that I'm not certain this would reliably work for all browsers), but that would be possible for a user with some basic tech savvy to spoof. Does the solution need to be secure? – Mark Amery Nov 11 '14 at 19:22
  • I have a page which can only be accessed if they enter a password I give them from the previous page. – sfdevotion Nov 11 '14 at 19:25
  • Ok.... so I got no help on this. Anyone??? – sfdevotion Nov 11 '14 at 20:27
  • @sfdevotion You got your answers. The fact that you can't understand them means you need to hit the books – AlexL Nov 11 '14 at 20:33

2 Answers2

0

What you want is how to prevent hotlinking. Here is a small tutorial: http://www.hongkiat.com/blog/smarter-way-to-prevent-image-hotlinking-with-htaccess/

AlexL
  • 1,699
  • 12
  • 20
  • Uh, by my reading this isn't what the OP is asking for at all. He wants the page to only be accessible if the user *did* follow a link from another site. – Mark Amery Nov 11 '14 at 19:21
  • The hotlinking mechanism can be used to filter for specific site. In that tutorial there is a section about allowing specific domains. – AlexL Nov 11 '14 at 19:22
  • And I have no idea how to use this. Honestly, I need someone to hold my hand cause this is going over my head. – sfdevotion Nov 11 '14 at 19:24
0

This method isn't 100% reliable, but you can use $HTTP_SERVER_VARS['HTTP_REFERER'] to get the current page that the user came from to access snow.php.