Ell20 Posted June 16, 2008 Share Posted June 16, 2008 Hi, Is there anyway in which you can determine which version of browser, more specifically if the user has Internet Explorer Version 6 or lower? If they do, is it possible to ask them to upgrade before they can view the site? Really appreciate any help on this Elliot Link to comment https://forums.phpfreaks.com/topic/110480-determine-browser/ Share on other sites More sharing options...
Orio Posted June 16, 2008 Share Posted June 16, 2008 Take a look into get_browser(). See the example over there, it explains the best. Orio. Link to comment https://forums.phpfreaks.com/topic/110480-determine-browser/#findComment-566810 Share on other sites More sharing options...
hitman6003 Posted June 16, 2008 Share Posted June 16, 2008 http://www.php.net/get_browser orio beat me to it.... : ) Link to comment https://forums.phpfreaks.com/topic/110480-determine-browser/#findComment-566811 Share on other sites More sharing options...
MasterACE14 Posted June 16, 2008 Share Posted June 16, 2008 I use this code for web browser checking: <?php // Web Browser Check // _______ // ----- | CONF. | // // add new browsers in lower case here, separated // by spaces - order is important: from left to // right browser family becomes more precise $browsers = "mozilla msie gecko firefox "; $browsers.= "konqueror safari netscape navigator "; $browsers.= "opera mosaic lynx amaya omniweb"; // _______ // ----- |PROCESS| // $browsers = split(" ", $browsers); $nua = strToLower( $_SERVER['HTTP_USER_AGENT']); $l = strlen($nua); for ($i=0; $i<count($browsers); $i++){ $browser = $browsers[$i]; $n = stristr($nua, $browser); if(strlen($n)>0){ $GLOBALS["ver"] = ""; $GLOBALS["nav"] = $browser; $j=strpos($nua, $GLOBALS["nav"])+$n+strlen($GLOBALS["nav"])+1; for (; $j<=$l; $j++){ $s = substr ($nua, $j, 1); if(is_numeric($GLOBALS["ver"].$s) ) $GLOBALS["ver"] .= $s; else break; } } } // _______ // ----- | USE | // //echo("<pre>Your browser is: "); //echo($GLOBALS["nav"] . " " . $GLOBALS["ver"] . "</pre>"); ?> Regards ACE Link to comment https://forums.phpfreaks.com/topic/110480-determine-browser/#findComment-566888 Share on other sites More sharing options...
Orio Posted June 17, 2008 Share Posted June 17, 2008 Or simply... <?php $browser = get_browser(null, true); echo "You are using {$browser['browser']} version {$browser['version']}"; ?> Orio. Link to comment https://forums.phpfreaks.com/topic/110480-determine-browser/#findComment-567120 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.