Fix REMOTE_ADDR on x10hosting

ezadx10b

New Member
Messages
29
Reaction score
0
Points
1
Hello all x10hosting user.have a nice day.we have login on cpanel and we can see have cloudflare there. The problem is when we use to detect user on our site, we get the ip only from cloudflare not the user real ip. firstly you need to change from REMOTE_ADDR to HTTP_X_FORWARDED_FOR to get user real ip address. example just like this PHP = $_SERVER["HTTP_X_FORWARDED_FOR"]; PERL = $ENV{"HTTP_X_FORWARDED_FOR"}; If you are using joomla,wordpress etc you can download here https://www.cloudflare.com/resources-downloads Almost forget about it. You also can use $_SERVER["HTTP_CF_IPCOUNTRY"]; to get user country code everything what im doing here you can check on my site http://www.ezad.x10.bz/err/error-page.php Thanks, Greetings from me x10hosting users in malaysia.
 
Last edited:
Top