I'm having problems with Nigerian scammers on my website. I am trying my best to keep them off, but many times they are changing their ip addresses so that they appear to be coming from the United States. Below is a code I am currently using to detect the true ip address of a visitor to my site, but I find that there are many times it does not reveal the true IP address of a person. Does anyone have a better code or perhaps show me how I may improve the current code I am using?
Thanks in advance,
Owen The Samoan
function getIpAddress() {
return (empty($SERVER['HTTP_CLIENT_IP'])?(empty($SERVER['HTTP_X_FORWARDED_FOR'])?
$SERVER['REMOTE_ADDR']:$SERVER['HTTP_X_FORWARDED_FOR']):$_SERVER['HTTP_CLIENT_IP']);
}