By Anuprita Sapate on
Hello,
Is there any module that can tell the default current location city of the user on their site.
Eg. if the user is accessing the site form pune it should display location -pune,if from mumbai display the location mumbai.
Comments
First go and download php
First go and download php class for here http://ipinfodb.com/ip_location_api.php it will give you class ip2locationlite.class.php. Now in drupal custom module you can do this
You can use Google API for
You can use Google API for the location access via IP.
Where should i actually paste
Where should i actually paste this code?
I created a custom module name 'ip2locationlite' an extracted the file that u said.
Am i going right???
you have create module name
you have create module name ip2locationlite. Now Put that class(ip2locationlite.class.php) which you had download in module directory
put this code in ip2locationlite.module file
also clear the cache.
do i have to register for api
do i have to register for api key??
It is displaying-'City name' not the actual city name
In the above code and line $ipLite->setKey('your api key you have to register free to get key');
Do i have to register for instering here api key???
yes u have to register for
yes u have to register for the api key and insert that key in setkey function.
after registration for the
after registration for the key also the actual city name is not being displayed.Can u tell what could be the problem??
r u testing on localhost? plz
r u testing on localhost? plz test the code on live server it will work on live server.
Yes i were testing on
Yes i were testing on localserver.
Ok thx i'll check on live server