I have created one web application using PHP. I want know the IP randomly generated or not from proxy or client side application. Our application only allow one click per IP address.
I had checked the user agent by using $_SERVER['HTTP_USER_AGENT']
. I got the user agent currently. but I want know whether the user agent using any other tool to generate IP address
dynamically. is it possible to check by using the code?
You can try this piece of code:
if (
$_SERVER['HTTP_X_FORWARDED_FOR']
|| $_SERVER['HTTP_X_FORWARDED']
|| $_SERVER['HTTP_FORWARDED_FOR']
|| $_SERVER['HTTP_CLIENT_IP']
|| $_SERVER['HTTP_VIA']
|| in_array($_SERVER['REMOTE_PORT'], array(8080,80,6588,8000,3128,553,554))
|| @fsockopen($_SERVER['REMOTE_ADDR'], 80, $errno, $errstr, 30))
{
exit('Proxy detected');
}
Source: digitalpoint