| Server IP : 202.61.199.114 / Your IP : 216.73.217.139 Web Server : nginx/1.22.1 System : Linux de.arni-solutions.de 6.1.0-49-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.174-1 (2026-05-26) x86_64 User : web20 ( 1018) PHP Version : 8.4.23 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /var/www/clients/client2/web20/web/wp-content/themes/arni/includes/classes/ |
Upload File : |
<?php
class iptracking {
public $collection;
function __construct() {
$this->collection = array();
}
private function get_geolocation( $ip ) {
$url = "http://ip-api.com/json/" . $ip . "?fields=status,message,continent,continentCode,country,countryCode,region,regionName,city,district,zip,lat,lon,timezone,offset,currency,isp,org,as,asname,reverse,mobile,proxy,hosting,query&lang=de";
$cURL = curl_init();
curl_setopt($cURL, CURLOPT_URL, $url);
curl_setopt($cURL, CURLOPT_HTTPGET, true);
curl_setopt($cURL, CURLOPT_RETURNTRANSFER, true);
curl_setopt($cURL, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Accept: application/json'
));
$return = curl_exec( $cURL );
$return = json_decode( $return, true );
return $return;
}
private function get_date2zone ( $timezone ) {
$date = new DateTime("now", new DateTimeZone( $timezone ) );
$this->collection['timezone_date'] = $date->format('Y-m-d');
$this->collection['timezone_date_de'] = $date->format('d.m.Y');
$this->collection['timezone_time'] = $date->format('H:i');
}
public function getvar( $key ) {
if( count( $this->collection ) <= 0 ) $this->get();
return isset( $this->collection[ $key ] ) ? $this->collection[ $key ] : "key not found";
}
public function get( $ip = FALSE ) {
$this->collection = $this->get_geolocation( $ip ? $ip : $this->getIP() );
$this->get_date2zone( $this->collection['timezone'] );
}
public function getIP() {
if (!empty($_SERVER['HTTP_CLIENT_IP'])) {
$ip = $_SERVER['HTTP_CLIENT_IP'];
} else if (!empty($_SERVER['HTTP_X_FORWARDED_FOR'])) {
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
} else {
$ip = $_SERVER['REMOTE_ADDR'];
}
// Regel für local
if( $ip == "127.0.0.1" ) $ip = "surfboxx-it.de";
return $ip;
}
}