![]()
IP2Location™ has developed the extension module for DotNetNuke's content management system, an open source web platform based on Microsoft. It gives Web sites the ability to customize their websites in order to serve their customers better, such as displaying native languages and currency, redirect web pages based on geographical location, spam filtering by location and much more. #Ip2location free databases codeThis is done by taking the IP address of the visitor and querying the database to get information regarding the IP address such as country, region, state, city, latitude, longitude, zip code, Internet service provider (ISP), time zone, connection speed, domain name, IDD country code, area code and weather station using their IP addresses. If you liked this article, then please subscribe to our YouTube Channel for video tutorials.PRLog - IP2Location™ is a geolocation database product that enables web sites to pinpoint the location of Internet customers and other information about their visitors. If you have more questions about the implementation, you can find more tutorials in IP2Location Blog. You can filter traffic, block or redirect users based on their locations. Once you can see all the geolocation fields returned by the IP2Location DB11 LITE data, you can use them in many scenarios. You should see all the geolocation data for your own IP address. $st = $pdo->prepare('select * from `ip2location_db11` where inet_aton(:ip) bindParam(':ip', $ip, PDO::PARAM_STR) Įcho 'country_code: '. $ip = $_SERVER // web visitor's IP address SetAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION) We will now create the PHP webpage to query the database and output the geolocation data for the page visitor.Ĭreate a page called test.php and paste the following code into it. Part 2: Querying the geolocation data in your PHP web page INFILE '/root/ip2location_data/IP2LOCATION-LITE-DB11.CSV' Now run the following in MySQL to import the data. ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin In your MySQL, run the following to create the database and table that we’ll store the DB11 data. Once you’ve downloaded the zipped file, extract out the IP2LOCATION-LITE-DB11.CSV data file to a folder called /root/ip2location_data (this is just an example folder name). #Ip2location free databases downloadThe first step is to download the DB11 LITE database file from which is free after sign-up. We’ll assume you are using MySQL as PHP usually operates with MySQL. Let’s assume your website is running an Apache web server with PHP powering the backend. ![]() #Ip2location free databases how toPart 2 will show how to use PHP to query the database and retrieve the results. Part 1 deals with creating the database & table as well as importing the data. ![]() We will explore how to implement this geolocation feature into your own website using PHP. Using the IP address of the web visitor, the website operator can target relevant ads, contents or change the language of the website based on your geolocation country. The most common is the showing of ads local to you even though the website may be foreign. ![]() Visit any websites and you’ll most likely find some form of localization being used. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |