Advertisement
szymcio93

Detecting browser

May 12th, 2015
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.63 KB | None | 0 0
  1. //DETECTING BROWSER PHP
  2. */
  3. /*$_SESSION["counter"]++;
  4. if($_SESSION["counter"]===7){
  5.     header('Location: /l4/gratulacje.html');
  6. }
  7.  
  8. */
  9. if(strstr($_SERVER['HTTP_USER_AGENT'],"Mozilla  ")){
  10.     header('HTTP/1.x 404 Not Found');
  11.     exit("Not Found");
  12. }
  13. else if(strstr($_SERVER['HTTP_USER_AGENT'],"Android")){
  14.     header('Location: /l4/mobile.html');
  15. }
  16.  
  17. //DETECTING BROWSER JS
  18. function Browser()
  19.     {
  20.     if((navigator.userAgent.indexOf("MSIE") != -1 )
  21.       alert('Remember to activate your copy of Windows');
  22.     }  
  23.     else
  24.     {
  25.        alert('Take it easy. Keep suring');
  26.     }
  27.     }
  28.     window.onload=Browser();
  29. </script>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement