The code on this page requires that visitors come from a specific domain or webpage.  It then displays a message depending on whether they came from the required domain/page or not. Put this code at the very top of your php page.{codecitation}/* would accept only traffic from the domain would accept only traffic from the specific index.php page on the domain
index.html would accept traffic from the index.html page on any domain


$requiredfrom = "";
if(isset($_SERVER['HTTP_REFERER']) && stristr($_SERVER['HTTP_REFERER'],$requiredfrom)){ //came from required url
  echo 'you are safe to continue surfing since you came here from a trusted location';
} else { //didn't come from the required url
  echo 'you were directed here from an external link, non trusted link, or direct link (via e-mail etc...)';