Page 1 of 1

sniffing the IP address

Posted: Fri Nov 27, 2015 12:25 pm
by xarzu
Hello Forum!

I apologize if this has already been asked and answered here.

How do I code my web site so that I can sniff out the IP address of the person visiting the site? I want to then redirect the user according to their IP address. Specifically, if the user is coming from an Arabic or Farsi country state, I want to redirect them to a different page (then if they specifically request to see the content in English, I will remember this by a cookie).

Re: sniffing the IP address

Posted: Fri Nov 27, 2015 8:05 pm
by Celauran
Using JavaScript to detect the browser language might be a better option.

https://localizejs.com/questions/integr ... -languages