Getting User's Real IP for Geo Location

Popular automatic website translation tool

Getting User's Real IP for Geo Location

Postby natastna2 » Sat Dec 10, 2016 6:18 am

Hello,

I was hoping you could help me capture the user's real IP address?

I am trying $_SERVER['HTTP_X_REAL_IP'] and $_SERVER["HTTP_X_FORWARDED_FOR"] but neither seem to be correct.

Thank you for your time.

Regards,
Anthony
natastna2
 
Posts: 158
Joined: Wed Jan 26, 2011 2:43 am

Re: Getting User's Real IP for Geo Location

Postby natastna2 » Sat Dec 10, 2016 9:34 pm

Just to provide more info:

When I echo the various SERVER variables when using Gtranslate I get:

xforward 188.65.113.126
xreal 188.65.113.126
xremoteadd 51.255.65.216
serveradd 188.65.113.126


But my actual IP address is: 94.192.59.14

188.65.113.126 is the IP of the server the websites are on and xremote is obviously the URL you are serving from.

I am unsure as to why HTTP_X_REAL_IP would show the IP of the server rather than the user. I am hoping you have seen this before!

Thank you for your time.

Regards,
Anthony
natastna2
 
Posts: 158
Joined: Wed Jan 26, 2011 2:43 am

Re: Getting User's Real IP for Geo Location

Postby Yana » Sat Dec 10, 2016 10:52 pm

Hi,

51.255.65.216 and 94.23.220.123 IP addresses are our server IP addresses.
X-Real-IP will display visitors IP address.
Regards,

Yana Ghahramanyan - GTranslate Team

Please leave your feedback on your CMS plugin directory. It is very important for us!
Google Translate Joomla
Google Translate WordPress
Google Translate Drupal
Yana
 
Posts: 4547
Joined: Thu Jan 12, 2012 6:21 pm

Re: Getting User's Real IP for Geo Location

Postby natastna2 » Sat Dec 10, 2016 11:05 pm

Hi Yana,

Thank you for getting back to me.

Oddly I also get 188.65.113.126 as the IP address when I use X-REAL-IP. This is the IP address of the server but not the user.

Thank you for your time.

Regards,
Anthony
natastna2
 
Posts: 158
Joined: Wed Jan 26, 2011 2:43 am

Re: Getting User's Real IP for Geo Location

Postby Edvard » Sun Dec 11, 2016 5:16 am

Hi,

Please check with your hosting provider if they are using reverse proxy and ask to set appropriate headers for you. Usually if the request travels through multiple proxy servers the HTTP_X_FORWARDED_FOR header contains all the IP addresses separated by comma.

Thanks!
Regards,

Edvard Ananyan - GTranslate Team

Please leave your feedback on your CMS plugin directory. It is very important for us!
Google Translate Joomla
Google Translate WordPress
Google Translate Drupal
Edvard
Site Admin
 
Posts: 4403
Joined: Mon Jun 28, 2010 1:54 pm
Location: Yerevan, Armenia


  • Related Topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 0 guests

cron