PHP Classes

File: demo.php

Recommend this page to a friend!
  Classes of Tiago André  >  Localization class  >  demo.php  >  Download  
File: demo.php
Role: Example script
Content type: text/plain
Description: demo file
Class: Localization class
Detect user location using HTML 5 API or GeoIP API
Author: By
Last change:
Date: 4 years ago
Size: 922 bytes


Class file image Download
$geoip=new geoIP();
$js_code_to_location = $geoip->location_html5("$('#city').text(place);");
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
<html xmlns="" xml:lang="en" lang="en">

    <meta http-equiv="content-type" content="text/html;charset=utf-8" />
    <meta name="generator" content="Geany 0.21" />
    <script type='text/javascript' src=''></script>
    <script src="//" type="text/javascript"></script>
    <?php echo $js_code_to_location; ?>

    <b>City via IP API</b>
    <?php print_r($country); ?>
    <b>city via HTML5 geolocalisation</b>
    <div id='city'></div>