function inAgent($agent) { $notAgent = strpos($_SERVER["HTTP_USER_AGENT"],$agent) === false; return !$notAgent; } if ( inAgent('MSIE 4') or inAgent('MSIE 5') ) { if ( inAgent('Mac') ) $browser = inAgent('MSIE 5') ? 'ie5mac' : 'ie4mac'; elseif ( inAgent('Win') ) $browser = 'iewin'; } elseif ( !inAgent('MSIE') ) { if ( inAgent('Mozilla/5') or inAgent('Mozilla/6') ) { $browser = 'ns6'; } elseif ( inAgent('Mozilla/4') ) { if ( inAgent('Mac') ) $browser = 'nsmac'; elseif ( inAgent('Win') ) $browser = 'nswin'; else $browser = 'nsunix'; } } else $browser = "unknown"; ?>
|
||||||||||||||||||||||||||||