Advertisement
tobitaz

user-agent.php

Aug 20th, 2013
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.34 KB | None | 0 0
  1. <?php
  2.  
  3.  
  4. $j2me = strripos($_SERVER["HTTP_USER_AGENT"], 'J2ME/MIDP');
  5. $iphone = strripos($_SERVER["HTTP_USER_AGENT"], 'iPhone');
  6. $om = strripos($_SERVER["HTTP_USER_AGENT"], 'Opera Mini');
  7.  
  8.  
  9.  
  10. if($j2me === false & $iphone === false & $om === false)
  11.  {
  12.  header('Location: desktop.php');
  13.  }
  14. else
  15.  {
  16.  header('Location: mobile.php');
  17.  }
  18.  
  19.  
  20. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement