Login   Register  
PHP Classes
elePHPant
Icontem

File: implementation.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of azizny  >  User Info & GeoIP  >  implementation.php  >  Download  
File: implementation.php
Role: Example script
Content type: text/plain
Description: Implementation
Class: User Info & GeoIP
Get information about the current user browser
Author: By
Last change:
Date: 6 years ago
Size: 1,923 bytes
 

Contents

Class file image Download
<?php
/**************************************************/
/*
Released by AwesomePHP.com, under the GPL License, a
copy of it should be attached to the zip file, or
you can view it on http://AwesomePHP.com/gpl.txt
*/
/**************************************************/

/*
user info class implementation
*/

require_once('userinfo.class.php');

$userInfo = new getUserInfo();

/* Load System */
$userInfo->loadSystem();

/* User Browser */
echo 'Browser: '.$userInfo->getBrowser();

/* Operating System */
echo '<br />System: '.$userInfo->getSystem();

/* User IP */
echo '<br />IP: '.$userInfo->getIP();

/* Get System Language */
list($languageCode,$languageName) = $userInfo->getLanguage();
echo 
'<br />Language Code: '.$languageCode;
echo 
'<br />Language Name: '.$languageName;

/* User referral */
echo '<br />User Referreal URL: '.$userInfo->getReferer();

/* Is Referral a search engine? */
echo '<br />User Referral Search Engine: '.$userInfo->getEngine();

/*
Custom Checks - May Require Page Reload on some Servers 
Uses Cookies to transfer variables to PHP Engine
*/

/* Load Cookies (Used for javascript/flash checking) */
$userInfo->printFlashHTML();
$cookie $userInfo->checkJavaFlashCookie();

/* Check for Javascript */
if($cookie == NULL){ echo '<br />Javascript Disabled';}else{ echo '<br />Javascript Enabled';}

/* Check for Flash */
switch ($cookie)
{
    case 
true: echo '<br />Flash Enabled';break;
    case 
false: echo '<br />Flash Disabled';break;
}

/* Check for Speed */
$speed $userInfo->getSpeed();
echo 
'<br />Speed Kpbs: '.$speed;

/*
Get Country - Requires Database/Installtion.
http://www.maxmind.com/app/geolitecountry
Download the CSV file, extract it to the helper.folder
Run helper.folder/installDatabase.php
Do the same whenever you want to update the database
*/
//echo '<br />Country: '.$userInfo->getCountry();
?>