Categories:
Cloud (204)
Entertainment (11)
Facebook (43)
General (50)
Life (31)
Programming (64)
Technology (430)
Testing (4)
Tools (488)
Twitter (5)
Wearable (26)
Web Design (44)
Collections:
Other Resources:
How to get users’ IP Address with PHP
Useful PHP Code Snippets for Developers - How to get users’ IP Address with PHP
✍: Guest
function getRealIpAddr()
{
if (!empty($_SERVER['HTTP_CLIENT_IP'])) //check ip from share internet
{
$ip=$_SERVER['HTTP_CLIENT_IP'];
}
elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) //to check ip is pass from proxy
{
$ip=$_SERVER['HTTP_X_FORWARDED_FOR'];
}
else
{
$ip=$_SERVER['REMOTE_ADDR'];
}
return $ip;
}
2015-06-19, 1616🔥, 0💬
Popular Posts:
Where to find tutorials on LibGen (Library Genesis)? Here is a large collection of tutorials to answ...
How to turn on or off comments? I have a PowerPoint presentation which has comments entered by diffe...
What is outlook.office365.com? Our IT tells us to migrate to outlook.office365.com. outlook.office36...
Why I am getting the "Warning: Unresponsive Script" message box? How to avoid this message box? When...
How to troubleshoot Fitbit device sync issue? My Fitbit device is connected to my Windows computer, ...