geht das überhaupt?
bitte um rat
bitte um rat
<?
$agent = getenv("HTTP_USER_AGENT");
if (preg_match("/MSIE/i", "$agent")) {
//stuff to do if Internet Explorer
$browser = "You have internet explorer";
}
else if (preg_match("/Mozilla/i","$agent")) {
//stuff to do if Netscape
$browser = "You have Netscape";
}
else {
//stuff to do if an other
$browser = "You are using a browser different than netscape and IE";
}
echo $browser;
?>
MS IExplorer Mozilla/1.22(compatible;MSIE2.01;WindowsNT) Mozilla/2.0(compatible;MSIE3.0;AK;Windows95) Mozilla/2.0(compatible;MSIE3.02;Updatea;AK;AOL3.0;Windows95) Mozilla/4.0 (compatible; MSIE 4.0; Windows 95;BPH01) Mozilla/4.0 (compatible; MSIE 4.0; Mac_68000) Mozilla/4.0 (compatible; MSIE 4.0; Mac_PowerPC; e412354MCICDV4.0) Mozilla/4.0 (compatible; MSIE 4.0b2; Windows 95) Mozilla/4.0 (compatible; MSIE 5.0; AOL 4.0; Windows 95) Mozilla/4.0 (compatible; MSIE 5.0; MSN 2.5; Windows 98) Mozilla/4.0 (compatible; MSIE 5.0; Windows 95) Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1) Netscape: Mozilla/2.0(Macintosh;I;PPC) Mozilla/2.0(Win16;I) Mozilla/3.01Gold[de](Win16;I) Mozilla/4.03 [en] (X11; I; Linux 2.0.30 i686) Mozilla/4.01 [en] (Win95; I) Mozilla/4.01 [en]C-CCK-MCD (WinNT; I) Mozilla/4.01 [en]C-FedExIntl (Win95; I) Mozilla/4.5 [en] (X11; I; SunOS 5.6 sun4d) Mozilla/4.6 [en] (X11; I; FreeBSD 3.2-RELEASE i386) Mozilla/5.0 [en] (WinNT; I) Mozilla/5.0b1 [en] (X11; N; Linux 2.2.0 alpha; Nav) Other Browsers Mozilla/1.2 (Opera/2.02) Mozilla/3.0 (compatible; Opera/3.0; Windows 95) 3.51 Mozilla/3.0 (Windows 4.10;US) Opera 3.60 [en] DosLynx/0.8a Lynx 2.4-FM Lynx 2.5 libwww-FM/2.14 Lynx 2.9 (compatible Interactive Tcl/Tk News Ticker v0.06) Lynx/2-4-2 MU-MODS Lynx_ALynx/2.4 AmigaPort/1.29 amaya/V2.0a libwww/5.2.1 AIR_Mosaic(16bit)/v3.10.198.18 IBM WebExplorer DLL /v1.1 IBrowse/1.2 (AmigaOS 3.1) iCab/Pre1.4 (Macintosh; I; PPC)
Kommentar