| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061 |
- <?php
- define("DIR_LOCALISE", getcwd() . "/");
- include("geoipcity.inc");
- include("geoipregionvars.php");
-
- if (!empty($_SERVER['HTTP_CLIENT_IP'])) //check ip from share internet
- {
- $ip=$_SERVER['HTTP_CLIENT_IP'];
- }
- elseif (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) //to check ip is pass from proxy
- {
- $ip=$_SERVER['HTTP_X_FORWARDED_FOR'];
- }
- else
- {
- $ip=$_SERVER['REMOTE_ADDR'];
- }
-
- if ($ip == '127.0.0.1')
- {
- $ip = '93.17.95.144';
- }
-
- $gi = geoip_open(DIR_LOCALISE."GeoLiteCity.dat", GEOIP_STANDARD);
- $record = geoip_record_by_addr($gi, $ip);
-
- $pays = $record->country_code;
- $continent = $record->continent_code;
-
- $nompays = $record->country_name;
- $region = $GEOIP_REGION_NAME[$record->country_code][$record->region];
- $ville = $record->city ;
- $codepostal = $record->postal_code;
-
- $today = date("d-m")."-20".date('y')." ".date('H:i');
-
- $pathovh = $_SERVER['DOCUMENT_ROOT'];
-
- // on retourne les infos
- print('_TAG_');
- print ($pays);
- print('_TAG_');
- print ($continent);
- print('_TAG_');
- print ($ip);
- print('_TAG_');
- print ($today);
- print('_TAG_');
- print ($pathovh);
- print('_TAG_');
- print ($nompays);
- print('_TAG_');
- print ($region);
- print('_TAG_');
- print ($ville);
- print('_TAG_');
- print ($codepostal);
- print('_TAG_');
- ?>
|