/****************************************************************************************************************/ /* Description: This snippet is provide simple way to help user display Visitor's GeoLocation Using Web Service.*/ /* suggestions for different city locations across the country. */ /* There are 1 steps in this snippet. For information, please visit IP2Location tutorial page at: */ /*https://www.ip2location.com/tutorials/display-visitors-geolocation-using-web-service-in-php */ /****************************************************************************************************************/ '; echo 'alert("Welcome Visitors from '.$geoLocation['city_name'].'")'; echo ''; }else { echo '
You are in local server!

'; echo ''; } }else{ echo 'IP Address parsing error!'; } ?> IP2Location Web Service
Hello World!

Your IP address
Country Code:'."\n". $geoLocation['country_code'] . "\n
"; echo 'Country Name:'."\n". $geoLocation['country_name'] . "\n
"; echo 'Region Name:'."\n". $geoLocation['region_name'] . "\n
"; echo 'City Name:'."\n". $geoLocation['city_name'] . "\n
"; echo 'Latitude:'."\n". $geoLocation['latitude'] . "\n
"; echo 'Longitude:'."\n". $geoLocation['longitude'] . "\n
"; echo 'Zip code:'."\n". $geoLocation['zip_code'] . "\n
"; echo 'Time zone:'."\n". $geoLocation['time_zone'] . "\n
"; }else{ echo 'IP Address parsing error!'; } ?>