- <?php
- /*
- name: browser.php
- comments: return the visitor's browser
- author: psyphi
- e-mail: psyphi1st@hotmail.com
- last modified: 2005 February 9th
- */
-
- function return_browser()
- {
- $browser="Unknow";
-
- /* Mozilla */
- /* Important: Mozilla is the first test because the string "Mozilla"
- is in all browser with Gecko engine like Firefox ... */
- if(strchr($_SERVER[ 'HTTP_USER_AGENT' ], "Mozilla"))
- $browser="Mozilla";
-
- /* Netscape */
- if(strchr($_SERVER[ 'HTTP_USER_AGENT' ], "Netscape"))
- $browser = "Netscape";
-
- /* Safari (Mac OS) */
- else if(strchr($_SERVER[ 'HTTP_USER_AGENT' ], "Safari"))
- $browser = "Safari";
-
- /* FireFox */
- else if(strchr($_SERVER[ 'HTTP_USER_AGENT' ], "Firefox"))
- $browser = "Firefox";
-
- /* Konqueror (Gnu/Linux KDE) */
- else if(strchr($_SERVER[ 'HTTP_USER_AGENT' ], "Konqueror"))
- $browser="Konqueror";
-
- /* Epiphany (Gnu/Linux Gnome) */
- else if(strchr($_SERVER[ 'HTTP_USER_AGENT' ], "Epiphany"))
- $browser="Epiphany";
-
- /* Lynx (text browser) */
- else if(strchr($_SERVER[ 'HTTP_USER_AGENT' ], "Lynx"))
- $browser="Lynx";
-
- /* Internet Explorer (Win32) */
- /* Important: Internet Explorer test must be before Opera Test because
- string "MSIE" is also present in Opera */
- else if(strchr($_SERVER[ 'HTTP_USER_AGENT' ], "MSIE"))
- $browser ="Internet Explorer";
-
- /* Opera */
- if(strchr($_SERVER[ 'HTTP_USER_AGENT' ], "Opera"))
- $browser="Opera";
-
- return $browser;
- }
- ?>
<?php
/*
name: browser.php
comments: return the visitor's browser
author: psyphi
e-mail: psyphi1st@hotmail.com
last modified: 2005 February 9th
*/
function return_browser()
{
$browser="Unknow";
/* Mozilla */
/* Important: Mozilla is the first test because the string "Mozilla"
is in all browser with Gecko engine like Firefox ... */
if(strchr($_SERVER[ 'HTTP_USER_AGENT' ], "Mozilla"))
$browser="Mozilla";
/* Netscape */
if(strchr($_SERVER[ 'HTTP_USER_AGENT' ], "Netscape"))
$browser = "Netscape";
/* Safari (Mac OS) */
else if(strchr($_SERVER[ 'HTTP_USER_AGENT' ], "Safari"))
$browser = "Safari";
/* FireFox */
else if(strchr($_SERVER[ 'HTTP_USER_AGENT' ], "Firefox"))
$browser = "Firefox";
/* Konqueror (Gnu/Linux KDE) */
else if(strchr($_SERVER[ 'HTTP_USER_AGENT' ], "Konqueror"))
$browser="Konqueror";
/* Epiphany (Gnu/Linux Gnome) */
else if(strchr($_SERVER[ 'HTTP_USER_AGENT' ], "Epiphany"))
$browser="Epiphany";
/* Lynx (text browser) */
else if(strchr($_SERVER[ 'HTTP_USER_AGENT' ], "Lynx"))
$browser="Lynx";
/* Internet Explorer (Win32) */
/* Important: Internet Explorer test must be before Opera Test because
string "MSIE" is also present in Opera */
else if(strchr($_SERVER[ 'HTTP_USER_AGENT' ], "MSIE"))
$browser ="Internet Explorer";
/* Opera */
if(strchr($_SERVER[ 'HTTP_USER_AGENT' ], "Opera"))
$browser="Opera";
return $browser;
}
?>