I'mm building a site that will offer services in several cities and I'm looking for any ideas on how can i detect the visitor's ip address (as many sites doo), figure its location and durect them to the nearest city available.
Partially this would be like www.whatismyip.com
and i think its fairly easy to capture the ip address?
Secondly, how do i determine the location of a ip? is there a formula or database?.
And finally, how would i find the closest city available - would i use somehow a GPS system, or lattitude/langitude, etc?
any ideas will be truly appreciated.