Hey all,

I am fairly new at php and I could use your help. I was wondering if there is a way to find out where the user is from so that you could customize a page for them. IE if they are from the US I would like the page to look different then if they were from Canada... I would like to be able to do this automatically without having to prompt the user for their location. Is there a way to discover where a guest is surfing from using php or another free program... Thanks in advance for any help.

RG

$userhost = gethostbyaddr($_SERVER['REMOTE_ADDR']);
if(eregi(".us",$userhost))
		echo "You are from US";

Thanks... That work like a charm

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.