Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /*
- * Author: $ Blade83
- * Filename: client.class.php
- * Requires: client.js (http://pastebin.com/xyXDDxmP)
- *
- * Methods of this wonderful Class
- *
- * - is_Tor_connection() // Checks if the Client connect over a Tor Network
- * - is_bot() // Checks if the Client is a bot (google, Bing, yahoo etc...) or not.
- * - is_mobile() // Checks if the Client connects from a mobile phone or tablet pc etc...
- * - get_agent() // Returns the name of the Browser (Firefox, Crome, Safarie etc...)
- * - get_isp() // Returns the Provider name from the Client connection (T-Online, 1&1 etc.)
- * - get_real_ip() // If the Client connect over Proxy, this Method will try to get the real user IP
- * - is_anonyme_ip() // This Method checks if the IP address is equal to the dns address
- *
- * Further this Script reads Flashplayer settings from cookies that previously saved by client.js !
- *
- *
- */
- class client
- {
- public
- $flash_enabled = NULL,
- $flash_raw = NULL,
- $flash_majorversion = NULL,
- $flash_minorversion = NULL,
- $flash_revisionStr = NULL,
- $flash_revision = NULL,
- $mobile = NULL,
- $windowWidth = NULL,
- $windowHeight = NULL;
- public static function get_browser_detection_script($js_path='')
- {
- return '<script type="text/javascript" src="'.$js_path.'client.js"></script>'."\n";
- }
- public function __construct()
- {
- $this->set_flash_fields();
- if (isset($_COOKIE['windowWidth']) && !empty($_COOKIE['windowWidth']))
- {
- $this->windowWidth = $_COOKIE['windowWidth'];
- }
- if (isset($_COOKIE['windowHeight']) && !empty($_COOKIE['windowHeight']))
- {
- $this->windowHeight = $_COOKIE['windowHeight'];
- }
- // delete the cookies
- @setcookie('windowWidth', "", time()-10000, '/');
- @setcookie('windowHeight', "", time()-10000, '/');
- }
- public function set_flash_fields()
- {
- if (isset($_COOKIE['flash_installed']) && !empty($_COOKIE['flash_installed']))
- {
- if ($_COOKIE['flash_installed']=='true'){
- $this->flash_enabled = true;
- $this->flash_raw = $_COOKIE['flash_raw'];
- $this->flash_majorversion = $_COOKIE['flash_major'];
- $this->flash_minorversion = $_COOKIE['flash_minor'];
- $this->flash_revisionStr = $_COOKIE['flash_revisionStr'];
- $this->flash_revision = $_COOKIE['flash_revision'];
- }else{
- $this->flash_enabled = false;
- }
- }
- if (!headers_sent())
- {
- // delete the cookies
- @setcookie('flash_installed', "", time()-10000, '/');
- @setcookie('flash_raw', "", time()-10000, '/');
- @setcookie('flash_major', "", time()-10000, '/');
- @setcookie('flash_minor', "", time()-10000, '/');
- @setcookie('flash_revisionStr', "", time()-10000, '/');
- @setcookie('flash_revision', "", time()-10000, '/');
- }
- }
- public function get_real_ip()
- {
- // if is the connection a proxy connection, try to get the real client ip
- global $REMOTE_ADDR, $HTTP_CLIENT_IP;
- global $HTTP_X_FORWARDED_FOR, $HTTP_X_FORWARDED, $HTTP_FORWARDED_FOR, $HTTP_FORWARDED;
- global $HTTP_VIA, $HTTP_X_COMING_FROM, $HTTP_COMING_FROM;
- if (empty($REMOTE_ADDR)) {
- if (!empty($_SERVER) && isset($_SERVER['REMOTE_ADDR'])) {
- $REMOTE_ADDR = $_SERVER['REMOTE_ADDR'];
- }
- else if (!empty($_ENV) && isset($_ENV['REMOTE_ADDR'])) {
- $REMOTE_ADDR = $_ENV['REMOTE_ADDR'];
- }
- else if (@getenv('REMOTE_ADDR')) {
- $REMOTE_ADDR = getenv('REMOTE_ADDR');
- }
- }
- if (empty($HTTP_CLIENT_IP)) {
- if (!empty($_SERVER) && isset($_SERVER['HTTP_CLIENT_IP'])) {
- $HTTP_CLIENT_IP = $_SERVER['HTTP_CLIENT_IP'];
- }
- else if (!empty($_ENV) && isset($_ENV['HTTP_CLIENT_IP'])) {
- $HTTP_CLIENT_IP = $_ENV['HTTP_CLIENT_IP'];
- }
- else if (@getenv('HTTP_CLIENT_IP')) {
- $HTTP_CLIENT_IP = getenv('HTTP_CLIENT_IP');
- }
- }
- if (empty($HTTP_X_FORWARDED_FOR)) {
- if (!empty($_SERVER) && isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
- $HTTP_X_FORWARDED_FOR = $_SERVER['HTTP_X_FORWARDED_FOR'];
- }
- else if (!empty($_ENV) && isset($_ENV['HTTP_X_FORWARDED_FOR'])) {
- $HTTP_X_FORWARDED_FOR = $_ENV['HTTP_X_FORWARDED_FOR'];
- }
- else if (@getenv('HTTP_X_FORWARDED_FOR')) {
- $HTTP_X_FORWARDED_FOR = getenv('HTTP_X_FORWARDED_FOR');
- }
- }
- if (empty($HTTP_X_FORWARDED)) {
- if (!empty($_SERVER) && isset($_SERVER['HTTP_X_FORWARDED'])) {
- $HTTP_X_FORWARDED = $_SERVER['HTTP_X_FORWARDED'];
- }
- else if (!empty($_ENV) && isset($_ENV['HTTP_X_FORWARDED'])) {
- $HTTP_X_FORWARDED = $_ENV['HTTP_X_FORWARDED'];
- }
- else if (@getenv('HTTP_X_FORWARDED')) {
- $HTTP_X_FORWARDED = getenv('HTTP_X_FORWARDED');
- }
- }
- if (empty($HTTP_FORWARDED_FOR)) {
- if (!empty($_SERVER) && isset($_SERVER['HTTP_FORWARDED_FOR'])) {
- $HTTP_FORWARDED_FOR = $_SERVER['HTTP_FORWARDED_FOR'];
- }
- else if (!empty($_ENV) && isset($_ENV['HTTP_FORWARDED_FOR'])) {
- $HTTP_FORWARDED_FOR = $_ENV['HTTP_FORWARDED_FOR'];
- }
- else if (@getenv('HTTP_FORWARDED_FOR')) {
- $HTTP_FORWARDED_FOR = getenv('HTTP_FORWARDED_FOR');
- }
- }
- if (empty($HTTP_FORWARDED)) {
- if (!empty($_SERVER) && isset($_SERVER['HTTP_FORWARDED'])) {
- $HTTP_FORWARDED = $_SERVER['HTTP_FORWARDED'];
- }
- else if (!empty($_ENV) && isset($_ENV['HTTP_FORWARDED'])) {
- $HTTP_FORWARDED = $_ENV['HTTP_FORWARDED'];
- }
- else if (@getenv('HTTP_FORWARDED')) {
- $HTTP_FORWARDED = getenv('HTTP_FORWARDED');
- }
- }
- if (empty($HTTP_VIA)) {
- if (!empty($_SERVER) && isset($_SERVER['HTTP_VIA'])) {
- $HTTP_VIA = $_SERVER['HTTP_VIA'];
- }
- else if (!empty($_ENV) && isset($_ENV['HTTP_VIA'])) {
- $HTTP_VIA = $_ENV['HTTP_VIA'];
- }
- else if (@getenv('HTTP_VIA')) {
- $HTTP_VIA = getenv('HTTP_VIA');
- }
- }
- if (empty($HTTP_X_COMING_FROM)) {
- if (!empty($_SERVER) && isset($_SERVER['HTTP_X_COMING_FROM'])) {
- $HTTP_X_COMING_FROM = $_SERVER['HTTP_X_COMING_FROM'];
- }
- else if (!empty($_ENV) && isset($_ENV['HTTP_X_COMING_FROM'])) {
- $HTTP_X_COMING_FROM = $_ENV['HTTP_X_COMING_FROM'];
- }
- else if (@getenv('HTTP_X_COMING_FROM')) {
- $HTTP_X_COMING_FROM = getenv('HTTP_X_COMING_FROM');
- }
- }
- if (empty($HTTP_COMING_FROM)) {
- if (!empty($_SERVER) && isset($_SERVER['HTTP_COMING_FROM'])) {
- $HTTP_COMING_FROM = $_SERVER['HTTP_COMING_FROM'];
- }
- else if (!empty($_ENV) && isset($_ENV['HTTP_COMING_FROM'])) {
- $HTTP_COMING_FROM = $_ENV['HTTP_COMING_FROM'];
- }
- else if (@getenv('HTTP_COMING_FROM')) {
- $HTTP_COMING_FROM = getenv('HTTP_COMING_FROM');
- }
- }
- // Gets the default ip sent by the user
- if (!empty($REMOTE_ADDR)) {
- $direct_ip = $REMOTE_ADDR;
- }
- // Gets the proxy ip sent by the user
- $proxy_ip = '';
- if (!empty($HTTP_X_FORWARDED_FOR)) {
- $proxy_ip = $HTTP_X_FORWARDED_FOR;
- } else if (!empty($HTTP_X_FORWARDED)) {
- $proxy_ip = $HTTP_X_FORWARDED;
- } else if (!empty($HTTP_FORWARDED_FOR)) {
- $proxy_ip = $HTTP_FORWARDED_FOR;
- } else if (!empty($HTTP_FORWARDED)) {
- $proxy_ip = $HTTP_FORWARDED;
- } else if (!empty($HTTP_VIA)) {
- $proxy_ip = $HTTP_VIA;
- } else if (!empty($HTTP_X_COMING_FROM)) {
- $proxy_ip = $HTTP_X_COMING_FROM;
- } else if (!empty($HTTP_COMING_FROM)) {
- $proxy_ip = $HTTP_COMING_FROM;
- }
- // Returns the true IP if it has been found, else ...
- if (empty($proxy_ip)) {
- // True IP without proxy
- return $direct_ip;
- }
- else {
- $is_ip = ereg('^([0-9]{1,3}.){3,3}[0-9]{1,3}', $proxy_ip, $regs);
- if ($is_ip && (count($regs) > 0)) {
- // True IP behind a proxy
- return $regs[0];
- }
- else {
- if (empty($HTTP_CLIENT_IP)) {
- // Can't define IP: there is a proxy but we don't have
- // information about the true IP
- return "(unbekannt) " . $proxy_ip;
- }
- else {
- // better than nothing
- return $HTTP_CLIENT_IP;
- }
- }
- }
- }
- public function is_anonyme_ip()
- {
- $ip = substr(getenv("REMOTE_ADDR"), 0, 14);
- $dns = @gethostbyaddr($ip);
- $true_ip = $this->get_real_ip();
- $true_dns = @gethostbyaddr($true_ip);
- if ( ($ip != $true_ip) || ($dns != $true_dns) )
- return $true_ip;
- else
- return false;
- }
- public function get_ip()
- {
- if(getenv("HTTP_CLIENT_IP"))
- $ip = getenv("HTTP_CLIENT_IP");
- elseif(getenv("HTTP_X_FORWARDED_FOR"))
- $ip = getenv("HTTP_X_FORWARDED_FOR");
- else
- $ip = getenv("REMOTE_ADDR");
- return $ip;
- }
- public function check_ip($ip)
- {
- #$IP = '198.168.1.78';
- if ( preg_match('/^(([1-9]?[0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]).){3}([1-9]?[0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/', $ip) ) {
- return $ip;
- }
- else {
- return FALSE;
- }
- }
- public function get_host()
- {
- return $this->host = @gethostbyaddr($_SERVER['REMOTE_ADDR']);
- }
- public function get_isp()
- {
- $this->isp = ("unbekannt");
- $host = $this->get_host();
- $prft = substr("$host", -10);
- #$pral = substr("$host", -12);
- $prta = substr("$host", -11);
- $prar = substr("$host", -13);
- $prcl = substr("$host", -9);
- $prewe = substr("$host", -11);
- $prbw = substr("$host", -11);
- $prntp = substr("$host", -11);
- $prntdr = substr("$host", -17);
- $prtcho = substr("$host", -10);
- $prtisis = substr("$host", -20);
- $prtnorom = substr("$host", -19);
- $prtosnt = substr("$host", -11);
- $prtnfk2 = substr("$host", -11);
- $prbrnt = substr("$host", -16);
- $prtclx = substr("$host", -9);
- $prtnfk1 = substr("$host", -11);
- $prips = substr("$host", -15);
- $prtcall = substr("$host", -14);
- $prtold = substr("$host", -13);
- $prslbg = substr("$host", -19);
- $prknt = substr("$host", -15);
- $prtisc = substr("$host", -11);
- $prprcm = substr("$host", -13);
- $prvetl = substr("$host", -12);
- $prmnet = substr("$host", -15);
- $prtmrbg = substr("$host", -11);
- $prtkmp = substr("$host", -12);
- $prdthw = substr("$host", -16);
- $prtchtl = substr("$host", -10);
- $prtccom = substr("$host", -13);
- $prnwton = substr("$host", -15);
- $prnwqsc = substr("$host", -7);
- $praol = substr("$host", -12);
- $prtonld = substr("$host", -18);
- if($host == "localhost") $this->isp = "localhost";
- elseif($prft == ".pppool.de") $this->isp = "Freenet";
- elseif($praol == ".ipt.aol.com") $this->isp = "AOL";
- elseif($prta == ".telekom.at") $this->isp = "Telekom Austria";
- elseif($prar == ".arcor-ip.net") $this->isp = "Arcor";
- elseif($prcl == ".ddkom.ne") $this->isp = "ChemTel";
- elseif($prbw == ".bluewin.ch") $this->isp = "BlueWin";
- elseif($prewe == ".ewetel.net") $this->isp = "EWEtel";
- elseif($prntp == ".net-htp.de") $this->isp = "HTP";
- elseif($prntdr == ".internode.on.net") $this->isp = "Internode";
- elseif($prips == ".iprimus.net.au") $this->isp = "iPrimus";
- elseif($prvetl == ".versanet.de") $this->isp = "Versatel";
- elseif($prmnet == ".mnet-online.de") $this->isp = "M-net";
- elseif($prknt == ".netcologne.de") $this->isp = "KοΏ½ln net";
- elseif($prprcm == ".primacom.net") $this->isp = "primacom";
- elseif($prslbg == ".salzburg-online.at") $this->isp = "Salzburg-online";
- elseif($prtold == ".t-dialin.net") $this->isp = "T-Online";
- elseif($prtonld == ".t-online.de") $this->isp = "T-Online";
- elseif($prtisc == ".tiscali.de") $this->isp = "Tiscali";
- elseif($prbrnt == ".datahighways.de") $this->isp = "Broadnet";
- elseif($prdthw == ".datahighways.de") $this->isp = "Datahighway";
- elseif($prtccom == ".hispeed.ch") $this->isp = "Cablecom";
- elseif($prtcall == ".mediaways.net") $this->isp = "Callando";
- elseif($prtcho == ".surfer.at") $this->isp = "Chello";
- elseif($prtchtl == ".ddkom.net") $this->isp = "ChemTel";
- elseif($prtisis == ".isionline-dialin.de") $this->isp = "isis";
- elseif($prtkmp == ".kamp-dsl.de") $this->isp = "Kamp";
- elseif($prtmrbg == ".mab.km3.de") $this->isp = "Marienburg";
- elseif($prtnfk1 == ".nefkom.net") $this->isp = "Nefkom";
- elseif($prtnfk2 == ".NEFkom.net") $this->isp = "Nefkom";
- elseif($prtclx == ".celox.de") $this->isp = "Celox";
- elseif($prtnorom == ".ewe-ip-backbone.de") $this->isp = "NordCom";
- elseif($prtosnt == ".osnanet.de") $this->isp = "Osnanet";
- elseif($prnwton == ".t-ipconnect.de") $this->isp = "T-Online";
- elseif($prnwqsc == ".qsc.de") $this->isp = "QSC";
- if($this->isp == "unbekannt")
- {
- // it looks like that this list is out of date!
- // pls send a email to me that includes the hostname.
- // i will update this list
- @mail('mail@blade83.de', 'Script: Unknown ISP Hostaddress in client::get_isp() !!!', 'Hostname: '.$this->get_host());
- }
- return $this->isp;
- }
- public function get_agent()
- {
- /*
- // Internet Exlporer
- $msie = strpos($ua, 'MSIE') ? true : false; // All Internet Explorer
- $msie_7 = strpos($ua, 'MSIE 7.0') ? true : false; // Internet Explorer 7
- $msie_8 = strpos($ua, 'MSIE 8.0') ? true : false; // Internet Explorer 8
- */
- if(preg_match("#Firefox#",$_SERVER['HTTP_USER_AGENT']))
- $this->agent = "Firefox";
- elseif(preg_match("#MSIE#",$_SERVER['HTTP_USER_AGENT']))
- $this->agent = "MS IE" ;
- elseif(preg_match("#Opera#",$_SERVER['HTTP_USER_AGENT']))
- $this->agent = "Opera";
- elseif(preg_match("#Netscape#",$_SERVER['HTTP_USER_AGENT']))
- $this->agent = "Netscape Navigator";
- elseif(preg_match("#Chrome#",$_SERVER['HTTP_USER_AGENT']))
- $this->agent = "Chrome";
- elseif(preg_match("#Safari#",$_SERVER['HTTP_USER_AGENT']))
- $this->agent = "Safari";
- else {
- $this->agent = "unbekannt";
- // it looks like that this list is out of date!
- // pls send a email to me that includes the $_SERVER['HTTP_USER_AGENT']
- // i will update this list
- @mail('mail@blade83.de', 'Script: Unknown HTTP_USER_AGENT in client::get_agent() !!!', 'Agent: '.$_SERVER['HTTP_USER_AGENT']);
- }
- return $this->agent;
- }
- public function is_mobile()
- {
- $agents = array('Windows CE',
- 'webos',
- 's8000',
- 'bada',
- 'googlebot-mobile',
- 'incognito',
- 'webmate',
- 'android',
- 'dream',
- 'cupcake',
- 'Pocket',
- 'Mobile',
- 'Portable',
- 'Smartphone',
- 'SDA',
- 'PDA',
- 'Handheld',
- 'Symbian',
- 'WAP',
- 'Palm',
- 'Avantgo',
- 'cHTML',
- 'BlackBerry',
- 'Opera Mini',
- 'Nokia',
- 'ipod',
- 'iPhone'
- );
- /*
- * If u have a newer list, please send it to 'mail@blade83.de'
- * Subject: mobile_agents_list
- */
- for ($i=0; $i < count($agents); $i++)
- {
- if(isset($_SERVER["HTTP_USER_AGENT"]) && strpos(strtolower($_SERVER["HTTP_USER_AGENT"]), strtolower($agents[$i])) !== false)
- {
- $this->mobile = $agents[$i];
- return true;
- }
- }
- return false;
- }
- public function is_bot()
- {
- $bots = array('bingbot', 'msn', 'abacho', 'abcdatos', 'abcsearch', 'acoon', 'adsarobot', 'aesop', 'ah-ha',
- 'alkalinebot', 'almaden', 'altavista', 'antibot', 'anzwerscrawl', 'aol', 'search', 'appie', 'arachnoidea',
- 'araneo', 'architext', 'ariadne', 'arianna', 'ask', 'jeeves', 'aspseek', 'asterias', 'astraspider', 'atomz',
- 'augurfind', 'backrub', 'baiduspider', 'bannana_bot', 'bbot', 'bdcindexer', 'blindekuh', 'boitho', 'boito',
- 'borg-bot', 'bsdseek', 'christcrawler', 'computer_and_automation_research_institute_crawler', 'coolbot',
- 'cosmos', 'crawler', 'crawler@fast', 'crawlerboy', 'cruiser', 'cusco', 'cyveillance', 'deepindex', 'denmex',
- 'dittospyder', 'docomo', 'dogpile', 'dtsearch', 'elfinbot', 'entire', 'web', 'esismartspider', 'exalead',
- 'excite', 'ezresult', 'fast', 'fast-webcrawler', 'fdse', 'felix', 'fido', 'findwhat', 'finnish', 'firefly',
- 'firstgov', 'fluffy', 'freecrawl', 'frooglebot', 'galaxy', 'gaisbot', 'geckobot', 'gencrawler', 'geobot',
- 'gigabot', 'girafa', 'goclick', 'goliat', 'googlebot', 'griffon', 'gromit', 'grub-client', 'gulliver',
- 'gulper', 'henrythemiragorobot', 'hometown', 'hotbot', 'htdig', 'hubater', 'ia_archiver', 'ibm_planetwide',
- 'iitrovatore-setaccio', 'incywincy', 'incrawler', 'indy', 'infonavirobot', 'infoseek', 'ingrid', 'inspectorwww',
- 'intelliseek', 'internetseer', 'ip3000.com-crawler', 'iron33', 'jcrawler', 'jeeves', 'jubii', 'kanoodle',
- 'kapito', 'kit_fireball', 'kit-fireball', 'ko_yappo_robot', 'kototoi', 'lachesis', 'larbin', 'legs',
- 'linkwalker', 'lnspiderguy', 'look.com', 'lycos', 'mantraagent', 'markwatch', 'maxbot', 'mercator', 'merzscope',
- 'meshexplorer', 'metacrawler', 'mirago', 'mnogosearch', 'moget', 'motor', 'muscatferret', 'nameprotect',
- 'nationaldirectory', 'naverrobot', 'nazilla', 'ncsa', 'beta', 'netnose', 'netresearchserver', 'ng/1.0',
- 'northerlights', 'npbot', 'nttdirectory_robot', 'nutchorg', 'nzexplorer', 'odp', 'openbot', 'openfind',
- 'osis-project', 'overture', 'perlcrawler', 'phpdig', 'pjspide', 'polybot', 'pompos', 'poppi', 'portalb',
- 'psbot', 'quepasacreep', 'rabot', 'raven', 'rhcs', 'robi', 'robocrawl', 'robozilla', 'roverbot', 'scooter',
- 'scrubby', 'search.ch', 'search.com.ua', 'searchfeed', 'searchspider', 'searchuk', 'seventwentyfour',
- 'sidewinder', 'sightquestbot', 'skymob', 'sleek', 'slider_search', 'slurp', 'solbot', 'speedfind', 'speedy',
- 'spida', 'spider_monkey', 'spiderku', 'stackrambler', 'steeler', 'suchbot', 'suchknecht.at-robot', 'suntek',
- 'szukacz', 'surferf3', 'surfnomore', 'surveybot', 'suzuran', 'synobot', 'tarantula', 'teomaagent', 'teradex',
- 't-h-u-n-d-e-r-s-t-o-n-e', 'tigersuche', 'topiclink', 'toutatis', 'tracerlock', 'turnitinbot', 'tutorgig',
- 'uaportal', 'uasearch.kiev.ua', 'uksearcher', 'ultraseek', 'unitek', 'vagabondo', 'verygoodsearch', 'vivisimo',
- 'voilabot', 'voyager', 'vscooter', 'w3index', 'w3c_validator', 'wapspider', 'wdg_validator', 'webcrawler',
- 'webmasterresourcesdirectory', 'webmoose', 'websearchbench', 'webspinne', 'whatuseek', 'whizbanglab', 'winona',
- 'wire', 'wotbox', 'wscbot', 'www.webwombat.com.au', 'xenu', 'link', 'sleuth', 'xyro', 'yahoobot', 'yahoo!',
- 'slurp', 'yandex', 'yellopet-spider', 'zao/0', 'zealbot', 'zippy', 'zyborg', 'mediapartners-google'
- );
- $regex = '('.implode($bots, ')|(').')';
- return eregi($regex, $_SERVER['HTTP_USER_AGENT']);
- }
- public function is_Tor_connection()
- {
- $reverse_client_ip = implode('.', array_reverse(explode('.', $_SERVER['REMOTE_ADDR'])));
- $reverse_server_ip = implode('.', array_reverse(explode('.', $_SERVER['SERVER_ADDR'])));
- $hostname = $reverse_client_ip . "." . $_SERVER['SERVER_PORT'] . "." . $reverse_server_ip . ".ip-port.exitlist.torproject.org";
- return gethostbyname($hostname) == "127.0.0.2";
- }
- }
- /*
- * Ok, this was the class. Now lets look how it workΒ΄s.
- */
- ?>
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html>
- <head>
- <title>Tor, Bot, Mobile, Agent, Internet Sharing Provider, Flash detection PHP Script</title>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <!-- At this time we should include the client.js file. If you saved the js file in the
- same folder as this php file use -->
- <?= client::get_browser_detection_script(); ?>
- <!-- Have you saved your client.js file in a Subfolder called 'js', then
- you can write this
- <?= client::get_browser_detection_script('js/'); ?> -->
- </head>
- <body>
- <?php
- /*
- * PHP usage:
- */
- $client = new client();
- echo 'Tor detect: '.($client->is_Tor_connection()?'1':'0')."\n";
- echo '<br>ip: '. $client->get_ip()."\n";
- echo '<br>is anonyme ip: '.($client->is_anonyme_ip()?'1':'0')."\n";
- echo '<br>is bot: '.($client->is_bot()?'1':'0')."\n";
- echo '<br>Der Gerät ist mobiles Gerät: '.($client->is_mobile() ? $client->mobile :'0')."\n";
- echo '<br>agent: '.$client->get_agent()."\n";
- echo '<br>host: '.$client->get_host()."\n";
- echo '<br>Internet Sharing Provider: '.$client->get_isp()."\n";
- echo '<br>flashversion: ';
- if ($client->flash_enabled) {
- echo $client->flash_raw."\n";
- }
- else{
- echo 'not installed'."\n";
- }
- echo '<br>WindowWidth: ' . $client->windowWidth ."\n";
- echo '<br>WindowHeight: ' . $client->windowHeight ."\n";
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement