If you get a bad referrer error even on a referrer in your referrers array if your site is on a PHP 5 server. The server variable: $HTTP_REFERER has been replaced with: $_SERVER['HTTP_REFERER'] Merely replace the line: $ref = parse_url($HTTP_REFERER); with $ref = parse_url($_SERVER['HTTP_REFERER']); Tada! Brought to you by: www.billwinkle.org/cdg