if ($_SERVER['HTTP_REFERER'] != 'http://www.foo.bar) { exit ("That's wrong!"); }