swa66 - 1:08 am on Feb 5, 2013 (gmt 0)
It's 'HTTP_REFERER' not 'HTTP REFERER'
If you found 20 on "HTTP REFERER", I'd be really surprised.
Check your apache logs if they log referrers, if they do , you can crosscheck what your script sees with what your web server saw.
HTTP_REFERER is not 100% reliable: you basically get what the browser choses to send you. Add-ons like RefControl for Firefox allow users control over what the browser sends to whom.