CodeXpress

Welcome, Guest: Join CodeXpress Log In!

Stats: 11 Members, 99 topics and 9 posts Date:  Thursday 29 October 2020 at 08:30 PM

This is a product of CodeXpress Buy License for your website

GeoPlugin Tutorial Get User Location Information IP Detection

CodeXpress / Science/Technology / PHP 7x / GeoPlugin Tutorial Get User Location Information IP Detection

18 people viewed

Geoplugin Tutorial Get User Location Information Ip Detection
(Go Down) (» Reply topic)
GeoPlugin Tutorial Get User Location Information IP Detection by Marshallunduemi(): Sun 30, August, 2020
Learn to use the GeoPlugin within your PHP scripts. GeoPlugin returns an array that you can easily parse using PHP. Detecting user location automatically according to their IP address requires that we have access to a GeoIP database to refer to in our programs. GeoPlugin offers that to you remotely which makes the set up of GEOIP programs much simpler and faster.

<?php
$user_ip = getenv('REMOTE_ADDR');
$geo = unserialize(file_get_contents("http://www.geoplugin.net/php.gp?ip=$user_ip"));
$city = $geo["geoplugin_city"];
$region = $geo["geoplugin_regionName"];
$country = $geo["geoplugin_countryName"];
echo "City: ".$city."<br>";
echo "Region: ".$region."<br>";
echo "Country: ".$country."<br>";
/*
geoplugin_request
geoplugin_status
geoplugin_credit
geoplugin_city
geoplugin_region
geoplugin_areaCode
geoplugin_dmaCode
geoplugin_countryCode
geoplugin_countryName
geoplugin_continentCode
geoplugin_latitude
geoplugin_longitude
geoplugin_regionCode
geoplugin_regionName
geoplugin_currencyCode
geoplugin_currencySymbol
geoplugin_currencySymbol_UTF8
geoplugin_currencyConverter
*/
?>

Welcome to CodeXpress Forum Script - Download NL script Free
(» Go Up)

You must Sign in or Sign Up to post content

For you to post content on this website you have to log in or register, it only take few minute to create account

Go Up

Recommended for you

Geoplugin Tutorial Get User Location Information Ip Detection

Currently: 1 guest(s) reading this article

Developed by Codexpress Programming Labs
Post content
Powered by Marshall