Categories:
Cloud (204)
Entertainment (11)
Facebook (43)
General (50)
Life (31)
Programming (64)
Technology (490)
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, ∼2200🔥, 0💬
Popular Posts:
What are Link and Activity LEDs on Ethernet Socket? Link and Activity LEDs on Ethernet Socket are LE...
How to see the key exchange process in an SFTP connection with FileZilla FTP Client? If you are conn...
What is "Send to Bluetooth" in Microsoft Word? Should I disable it? "Send to Bluetooth" is a COM Add...
What do those Fitbit icons mean? Over the years, Fitbit has used a number of icons on their wearable...
Sometimes I see special symbols are showing up at the end of each paragraph in my Microsoft Word doc...