WeberDev.com PHP and MySQL Code

LOG IN
BEGINNER GUIDESPHP CLASSESCODE SEARCHARTICLES SEARCHPHP FORUMSPHP MANUALPHP FUNCTIONS LISTWEB SITE TEMPLATES
Start typing to search for PHP and MySQL Code Snippets and Articles Search
Submit a code Example / Snippet Join us on FaceBook
Submit a code Example / Snippet Submit Your Code
Poker Tournaments Poker Tournaments
Poker Guide for Developers Poker Guide for Developers
Search Engine Optimization Monitor SEO Monitor
Web Site UpTime Monitor UpTime Monitor
Your Personal Examples List My Favorite Examples
Your Personal Articles List My Favorite Articles
Edit Account Info Update Your Profile
PHP Code Search
Web Development Forums
Learn MySQL Playing Trivia
PHPBB2 Templates
Web Development Resources
Web Development Content
Internet Security Software
PHPClasses
PHP Editor
PHP Jobs
Vision.To Design
Ajax Tutorials
PHP Programming Help
PHP/MySQL Programming
Webmaster Resources
Webmaster Forum
XML meta language
website builder
פרייסז - הכח לקנות עובר לידיים שלך
Texas Holdem Poker Evangelists

Go Back Add a Comment Send this example to a friend Add this Article to your personal favoritest for easy future access to your favorite Code Examples and Articles. Submit a code example Print this code example.
BACK ADD A COMMENT SEND TO A FRIEND ADD TO MY FAVORITES ADD CODE EXAMPLES PRINT
Title : Most of the browsers, especially Internet Explorer, behave in different ways. Hence it become necessary to use Browser detection to fix the non standard behavior of the browser. This is a browser sniffer class that can be used for the above purpose.
Categories : PHP, PHP Classes, Browsers Click here to Update Your Picture
Sumit Agarwal
Date : Nov 24th 2007
Grade : 3 of 5 (graded 2 times)
Viewed : 3158
File : No file for this code example.
Images : No Images for this code example.
Search : More code by Sumit Agarwal
Action : Grade This Code Example
Tools : My Examples List

Submit your own code examples  Submit your own code examples 
 

<?php
class Browser {
    function
Browser(){
       
$ua = $_SERVER['HTTP_USER_AGENT'];
       
$os = (strpos($ua, 'Mac') !== false) ? 'MAC' : (strpos($ua, 'Win') !== false) ? 'WIN' : 'NIX';
       
$this->isOpera = (($pos = strpos($ua, 'Opera')) !== false);
        if(
$this->isOpera){
           
$version = substr($ua, $pos + 6);
           
$this->isOpera7 = ($version >= 7);
           
$this->isOpera6 = ($version < 7);
        }
       
$this->isIE = (!$this->isOpera && ($pos = strpos($ua, 'MSIE')) !== false);
        if(
$this->isIE){
           
$version = substr($ua, $pos + 5);
           
$this->isIE6 = ($version >= 5.5);
           
$this->isIEWIN = (strpos($ua, 'Win') !== false);
           
$this->isIEMAC = (strpos($ua, 'Mac') !== false);
        }
       
$this->isNN = (!$this->isOpera && !$this->isIE && ($pos = strpos($ua, 'Mozilla')) !== false);
        if(
$this->isNN){
           
$version = substr($ua, $pos + 8);
           
$this->isNN6 = ($version >= 5);
           
$this->isNN4 = ($version == 4);
        }
       
$this->isGecko = (strpos($ua, 'Gecko/200') !== false);
       
$this->isSafari = (strpos($ua, 'Safari') !== false);
    }
}
?>



Usage Example
<?
$b
= new Browser();                                                     
echo
'<script src="' . ($b->isIE ? 'ie' : 'nn') . '.js"></script>'
?>



Automatic Browsers Detect
Categories : PHP, PHP Classes, Headers, Browsers
A script to generate a report from a valid mysql connection. The user has to supply which fields he wants to display in table. All properties are changable.
Categories : PHP, PHP Classes, Databases, MySQL, HTML and PHP
PHP class generator, must be used from Command line interface.
Categories : PHP, PHP Classes, Shell Scripting
XPertMailer - Sends TRUE Mails
Categories : PHP, Mail, SMTP, PHP Classes
ECHO-PHP Class Real Time Transaction Processor v1.4.4 for Credit Cards and Checks / ACH
Categories : PHP Classes, Cybercash, Classes and Objects, Ecommerce, PHP
ElfReader: An ELF (Executable and Linking Format) header information in PHP. Shows how to use the UNPACK function to read data.
Categories : PHP, Linux, PHP Classes
Sitmap Generator PHP class
Categories : PHP, PHP Classes, Search Engines, Site Planning
Parsing Simple Template Files and Data
Categories : PHP, PHP Classes, Templates, Regexps
Scan Apache access log files and report possible worms attack
Categories : PHP, PHP Classes, Security, Apache, Log Files
PHP CLASS for ORACLE (database connectivity)
Categories : PHP, PHP Classes, Classes and Objects, Databases, Oracle
Export Excel Dynamically to Csv then to mysql
Categories : PHP Classes, Excel, PHP
IRC Client class (RFC1459 Compliant)
Categories : PHP, PHP Classes, IRC
Browser Detection, Redirection Type, MSIE, MOZILLA, Netscape Navigator, NS, $HTTP_USER_AGENT, HTTP_USER_AGENT
Categories : PHP, HTTP, Browsers, HTML and PHP
Simple database class
Categories : PHP, PHP Classes, MySQL, Databases
PHP interface class to the eBusiness Charts generatation remote service.
Categories : PHP, PHP Classes, Graphics, Charts and Graphs