If you have say a login.php script, or any script, and want to stop it being run directly, or at least check that the referer is coming from your own site then all i can see to secure it are these, depending if it is a GET ot POST method,
$http_referer = parse_url($_SERVER['HTTP_REFERER'], PHP_URL_HOST);
if ( ($http_referer == "domain.com") || ($http_referer = "80.80.80.80.80") ){}
//POST or GET for example
if ($_SERVER['REQUEST_METHOD'] == "POST")
{}
Also how about having a max number of times you an access the page before a lockout, i suppose this would technically be a DOS attack which you would really have to fix at the router??
Basically i am being paranoid thinking that someone could try and break into your site by using a whole variety of tricks and techniques which i don't really know what tricks are out there so don't know what i am trying to secure against.
I suppose there is,
xss, css explots, sql injection, query string manipulation??, hacking the db directly, other browser exploits......hmmmm