How to get country of client

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
mukul_chou
Forum Newbie
Posts: 5
Joined: Tue Jun 17, 2008 4:23 am

How to get country of client

Post by mukul_chou »

Hello,
How can I get the country information of a user of my site. I know this to happen. For example
when I open google.com in the displayed page it gives a link of 'google india' for, I am browsing from India. Same is true for Yahoo. Also in some other site where there is a form to fill in I found in some cases the Country = India already chosen for me. But I can not remember if that was a php site.

Another Issue is,is there any way to obtain the mac address of the client machine through php?
User avatar
onion2k
Jedi Mod
Posts: 5263
Joined: Tue Dec 21, 2004 5:03 pm
Location: usrlab.com

Re: How to get country of client

Post by onion2k »

You can get the country from the user's IP address with the Maxmind database.. http://www.maxmind.com/app/geoip_country

You can't get the user's MAC address. And there's no good reason for you to want it anyway.
Post Reply