idontknowphp Posted October 12, 2009 Share Posted October 12, 2009 I am trying to figure out a redirect script that detects if the browser is IE 7 and if it does, redirect the user to another page. Is this even possible? Quote Link to comment https://forums.phpfreaks.com/topic/177459-simple-code-help-with-redirects/ Share on other sites More sharing options...
lemmin Posted October 12, 2009 Share Posted October 12, 2009 There is a get_browser() function: http://uk3.php.net/manual/en/function.get-browser.php Or you can just check the $_SERVER['HTTP_USER_AGENT'] variable. To redirect, change the header location with: header("Location: ie.php"); Quote Link to comment https://forums.phpfreaks.com/topic/177459-simple-code-help-with-redirects/#findComment-935675 Share on other sites More sharing options...
Alex Posted October 12, 2009 Share Posted October 12, 2009 If it doesn't work you'll need to get browscap.ini which isn't packaged with PHP. You can download it here And you'll need to set browscap to the path of that file in php.ini. Quote Link to comment https://forums.phpfreaks.com/topic/177459-simple-code-help-with-redirects/#findComment-935688 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.