Welcome to WebmasterWorld Guest from 100.26.182.28

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Code By Country?

Is there a way? New to PHP

     
8:54 pm on Jul 22, 2009 (gmt 0)

Junior Member

10+ Year Member

joined:Jan 13, 2006
posts: 125
votes: 0


Is there a way to have certain code execute based on what country the visitors are from?

Basically I want traffic from India or China to see one set of code and the rest to see another.

9:41 pm on July 22, 2009 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member whoisgregg is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Dec 9, 2003
posts:3416
votes: 0


It is possible to geolocate the IP address of the visitor with varying degrees of accuracy. There are some free databases out there which will do an excellent job of telling you what country a visitor is from. Anything more specific than that and the accuracy starts to drop rapidly.

Basically, you get one of those databases then just compare the $_SERVER['REMOTE_ADDR'] value against the db.

9:56 pm on July 22, 2009 (gmt 0)

Junior Member

10+ Year Member

joined:Jan 13, 2006
posts: 125
votes: 0


Soo many questions on that now. Are there any wordpress plugins that you know of that will do that? I guess that would be the easiest way for me.

Thank you for your answer!

10:33 pm on July 22, 2009 (gmt 0)

Junior Member

10+ Year Member

joined:Jan 13, 2006
posts:125
votes: 0


Ok NM. Your answer got me what I needed, whoisgregg. Thank you very much!
12:21 pm on July 23, 2009 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member whoisgregg is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:Dec 9, 2003
posts:3416
votes: 0


Happy to help. :)
 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members