Be sure that Ajax calls came from your domain in #php
Useful for be sure nobody steals your resources (cpu ecc) this script checks if the ajax call started from your domain. If not… dies.
$ref_domain = parse_url($_SERVER['HTTP_REFERER']);
if ( $_SERVER['SERVER_NAME'] != $ref_domain['host'])
die;