Advertisement
Guest User

Untitled

a guest
Apr 28th, 2012
201
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.18 KB | None | 0 0
  1. <?
  2.     //http://www.anyexample.com/programming/php/how_to_detect_internet_explorer_with_php.xml
  3.  
  4.    function ae_detect_ie()
  5.     {
  6.         if (isset($_SERVER['HTTP_USER_AGENT']) &&
  7.         (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== false))
  8.             return true;
  9.         else
  10.             return false;
  11.     }
  12.  
  13.     if(ae_detect_ie())
  14.     {
  15.         header("Location: noie.html");exit;
  16.     }
  17.  
  18.    function isOldMobileSafari()
  19.    {
  20.  
  21.         $browserAsString = $_SERVER['HTTP_USER_AGENT'];
  22.         if (strstr($browserAsString, " AppleWebKit/") && strstr($browserAsString, " Mobile/")&& strstr($browserAsString, "4_2"))
  23.         {
  24.             return true;
  25.         }
  26.         else
  27.         {
  28.             return false;
  29.         }
  30.    }
  31. ?>
  32. <div id="header">
  33.     <div id="topred">&nbsp;</div>
  34.     <div id="topgreen">&nbsp;</div>
  35.     <div id="topblue">&nbsp;</div>
  36.     <div id="topyellow">&nbsp;</div>
  37.     <a style="display:none" href="https://plus.google.com/118197810020432218051?rel=author">G+</a>
  38. </div>
  39. <script defer="defer">
  40.     //detect IOS version < 5, if yes, hide the footer since fixed pos does not work
  41.     var isOldMobileSafari = '<?= isOldMobileSafari(); ?>';
  42. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement