|
|
|
<?
###################
# http://www.tececo.com #
# #################
// Browser Detection
if( eregi("(opera) ([0-9]{1,2}.[0-9]{1,3}){0,1}",$_SERVER['HTTP_USER_AGENT'],$regs) ||
eregi("(opera/)([0-9]{1,2}.[0-9]{1,3}){0,1}",$_SERVER['HTTP_USER_AGENT'],$regs)){$browser
= "Opera $regs[2]";}
elseif( eregi("(konqueror)/([0-9]{1,2}.[0-9]{1,3})",$_SERVER
['HTTP_USER_AGENT'],$regs) ){$browser = "Konqueror $regs[2]";}
elseif( eregi("(omniweb/)([0-9]{1,2}.[0-9]{1,3})",$_SERVER['HTTP_USER_AGENT'],$regs) )
{$browser = "OmniWeb $regs[2]";}
elseif( eregi("(webtv/)([0-9]{1,2}.[0-9]{1,3})",$_SERVER['HTTP_USER_AGENT'],$regs) )
{$browser = "WebTV $regs[2]";}
elseif( eregi("(lynx)/([0-9]{1,2}.[0-9]{1,2}.[0-9]{1,2})",$_SERVER
['HTTP_USER_AGENT'],$regs) ){$browser = "Lynx $regs[2]";}
elseif( eregi("(links) \(([0-9]{1,2}.[0-9]{1,3})",$_SERVER['HTTP_USER_AGENT'],$regs) )
{$browser = "Links $regs[2]";}
elseif( eregi("(msie) ([0-9]{1,2}.[0-9]{1,3})",$_SERVER['HTTP_USER_AGENT'],$regs) )
{$browser = "MSIE $regs[2]";}
elseif( eregi("(netscape6)/(6.[0-9]{1,3})",$_SERVER['HTTP_USER_AGENT'],$regs) )
{$browser = "Netscape $regs[2]";}
elseif( eregi("mozilla/5",$_SERVER['HTTP_USER_AGENT']) ){$browser = "Netscape";}
elseif( eregi("(mozilla)/([0-9]{1,2}.[0-9]{1,3})",$_SERVER['HTTP_USER_AGENT'],$regs) )
{$browser = "Netscape $regs[2]";}
elseif( eregi("w3m",$_SERVER['HTTP_USER_AGENT']) ){$browser = "w3m";}
else{$browser = "Unknown";}
// OS Detection
if(eregi("linux",$_SERVER['HTTP_USER_AGENT'])){$system = "Linux";}
elseif(eregi("win32",$_SERVER['HTTP_USER_AGENT'])){$system = "Windows";}
elseif(eregi("Win 9x 4.90",$_SERVER['HTTP_USER_AGENT'])){$system = "Windows Me";}
elseif(eregi("windows 2000",$_SERVER['HTTP_USER_AGENT']) || eregi("(windows nt)( ){0,1}
(5.0)",$_SERVER['HTTP_USER_AGENT']) ){$system = "Windows 2000";}
elseif(eregi("(windows nt)( ){0,1}(5.1)",$_SERVER['HTTP_USER_AGENT']) ){$system = "Windows
XP";}
elseif( (eregi("(win)([0-9]{2})",$_SERVER['HTTP_USER_AGENT'],$regs)) || (eregi
("(windows) ([0-9]{2})",$_SERVER['HTTP_USER_AGENT'],$regs)) ){$system = "Windows $regs[2]";}
elseif(eregi("(winnt)([0-9]{1,2}.[0-9]{1,2}){0,1}",$_SERVER['HTTP_USER_AGENT'],$regs) )
{$system = "Windows NT $regs[2]";}
elseif(eregi("(windows nt)( ){0,1}([0-9]{1,2}.[0-9]{1,2}){0,1}",$_SERVER
['HTTP_USER_AGENT'],$regs) ){$system = "Windows NT $regs[3]";}
elseif(eregi("mac",$_SERVER['HTTP_USER_AGENT'])){$system = "Macintosh";}
elseif(eregi("(sunos) ([0-9]{1,2}.[0-9]{1,2}){0,1}",$_SERVER
['HTTP_USER_AGENT'],$regs)){$system = "SunOS $regs[2]";}
elseif(eregi("(beos) r([0-9]{1,2}.[0-9]{1,2}){0,1}",$_SERVER['HTTP_USER_AGENT'],$regs))
{$system = "BeOS $regs[2]";}
elseif(eregi("freebsd",$_SERVER['HTTP_USER_AGENT'])){$system = "FreeBSD";}
elseif(eregi("openbsd",$_SERVER['HTTP_USER_AGENT'])){$system = "OpenBSD";}
elseif(eregi("irix",$_SERVER['HTTP_USER_AGENT'])){$system = "IRIX";}
elseif(eregi("os/2",$_SERVER['HTTP_USER_AGENT'])){$system = "OS/2";}
elseif(eregi("plan9",$_SERVER['HTTP_USER_AGENT'])){$system = "Plan9";}
elseif(eregi("unix",$_SERVER['HTTP_USER_AGENT']) || eregi("hp-ux",$_SERVER
['HTTP_USER_AGENT']) || eregi("X11",$_SERVER['HTTP_USER_AGENT']) ){$system = "Unix";}
elseif(eregi("osf",$_SERVER['HTTP_USER_AGENT'])){$system = "OSF";}
else{$system = "Unknown";}
echo "You are using $browser on a $system system<br>";
?> |
|
| PHP Domain Availability Checker Categories : PHP, Complete Programs, Regexps, HTTP, Sockets | | | Grab links from a page Categories : PHP, Regexps, HTTP | | | Check if a file exists on a remote FTP server with PHP Categories : PHP, FTP, Regexps | | | Show Source with Line Numbers Categories : PHP, Regexps, Filesystem | | | Avoiding or Detecting high bit characters in a string. Useful when you want to create a valid RSS feed Categories : PHP, Strings, Unicode, Regexps, Rich Site Summary (RSS) | | | Simple way to replace a variable value in a .conf (.ini) file using a
webbrowser - the first stage of a complete universal configuration editor Categories : PHP, Regexps, Code Editors, Filesystem | | | ereg -- Regular expression match Categories : PHP, PHP Functions, Regexps | | | Simple Password example Categories : PHP, Authentication, Security, HTTP | | | BBCode Formatting String Categories : PHP, HTML, Regexps, Arrays | | | Tag content retrieval from websites with preg_match Categories : PHP, Regexps, Arrays, HTML and PHP | | | I need a trim function/regexp that will trim all " " from the ends of a string. Categories : Regexps, PHP, Strings | | | WebServerSpy checks which kind of Webserver is running, Apache, Netscape, Fasttrack, IIS, HTTP-Header, HTTP 1.0, GET, spy, WWW Categories : HTTP, Network, Apache, PHP, Web Servers | | | This script is a contact form between users of a
website (kinda like the PM function on the forums)
Categories : PHP, Databases, MySQL, Regexps | | | PHP4 HTTP Compression Speeds up the Web Categories : PHP, Zlib, HTML and PHP, HTTP, Network | | | Form input return conformance Categories : HTML and PHP, PHP, Regexps | |
|
|
|