Just a note tho martyn187 $_SERVER['HTTP_REFERER'] can be forged and also if someone is running a firewall it could be blocked so will show blank (as well as when it goes via a proxy) so best not to rely on this and use it for information purposes only.