Skip to content

Instantly share code, notes, and snippets.

@0xnbk
Created September 17, 2010 03:57
Show Gist options
  • Save 0xnbk/583663 to your computer and use it in GitHub Desktop.
Save 0xnbk/583663 to your computer and use it in GitHub Desktop.
Redirect To Page On Your Site, if browser is IE
<?php
//if the browser is Microsoft IE
//if (ereg('MSIE 6',$_SERVER['HTTP_USER_AGENT'])) {
if (strstr($_SERVER['HTTP_USER_AGENT'], "MSIE")) {
//if (ereg('MSIE 6',$_SERVER['HTTP_USER_AGENT']))
header("Location: your_error_page.php")
}?>
@0xnbk
Copy link
Author

0xnbk commented Sep 17, 2010

PHP snippet to detect if the browser is IE, and redirect to a destination page. Uncomment line 4 to detect JUST IE 6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment