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, 1690🔥, 0💬
Popular Posts:
How to use my iPhone and iPad to set up and manage Chromecast device on my TV? I have a Chromecast d...
How to edit Mozilla Firefox configuration file? Mozilla Firefox has a configuration file that contro...
How to turn on or off comments? I have a PowerPoint presentation which has comments entered by diffe...
How to install Mozilla Firefox 2.0 add-on: FireFTP? FireFTP is a Mozilla Firefox 2 add-on that provi...
How to log in to Microsoft Teams with a Web browser? I know that my company is using Microsoft Teams...