<?php

function checkReferrer(){
	if( isset($_SERVER['HTTP_REFERER']) ){
		$ref = str_replace('http', '', $_SERVER['HTTP_REFERER']);
		$ref = str_replace(':', '', $ref);
		$ref = str_replace('/', '', $ref);
		return ( $ref == $_SERVER['SERVER_ADDR'] );
	}else{
		return false;
	}
}
?>