sniffing the IP address

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
xarzu
Forum Newbie
Posts: 4
Joined: Fri May 25, 2007 2:20 pm

sniffing the IP address

Post 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).
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: sniffing the IP address

Post by Celauran »

Using JavaScript to detect the browser language might be a better option.

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