azukah Posted July 22, 2010 Share Posted July 22, 2010 would anyone know how to not only detect the browser but redirect to a different page?... once redirected to a different page, show the browser and its version and based on that, offer a link to upgrade to the newest version of that browser??? if the users have the latest version of whatever browser they are using, then no problem, they can go to the index BUT if users have earlier versions , they they are redirected to a page that offers them to upgrade to the latest of what they are using...??? Also, if mobile user, then will just use a different CSS Link to comment https://forums.phpfreaks.com/topic/208599-browser-detect-and-redirect/ Share on other sites More sharing options...
.josh Posted July 23, 2010 Share Posted July 23, 2010 $_SERVER['HTTP_USER_AGENT'] will have browser info from the header request. You will need to parse the info out, though get_browser may be useful for you for that. Make some conditions using if or switch and redirect with header (don't forget to exit after the header call to stop the rest of the script from executing). Link to comment https://forums.phpfreaks.com/topic/208599-browser-detect-and-redirect/#findComment-1089869 Share on other sites More sharing options...
inversesoft123 Posted July 23, 2010 Share Posted July 23, 2010 Check browser and then redirect. $text = $_SERVER['HTTP_USER_AGENT']; $var[0] = 'Nokia'; $var[1] = 'Mozilla/3.0'; - - - - $var[200] = 'HTC'; $result = count($var); for ($i=0;$i<$result;$i++) // Something like this $refactor = stristr($text, $var[$i]); Link to comment https://forums.phpfreaks.com/topic/208599-browser-detect-and-redirect/#findComment-1089994 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.