I would like a php script that disallows users to access a webpage directly. I seen a website whereby if you access its webpage from the address bar or other websites, the content will not be displayed. instead, it will say something like "You did not reach this page from www.domain.com/blah.html" Basically, it checks the referer site and make sure its from their own domain, and then display the info. can anyone show me where to get the script, or point me in the right direction. I am starting to learn PHP, so maybe if it is a simple script, I can do it myself. Thanks.
To get the referer, you can use the $_SERVER['HTTP_REFERER'] variable with contains it. Then you can use parse_url (or more simply, strstr) to check the domain. Note: the referrer can easily be faked. Jay
Referrer is not always set on browsers, so this method will only cause you headaches. Best bet is to have them click a button to go to the next page (which can look like a link through CSS) and then pass a POST variable which you then check.