Guest User

rotate based on user agent

a guest
Nov 4th, 2014
130
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. $iphone = strpos($_SERVER['HTTP_USER_AGENT'],"iPhone");
  3. $android = strpos($_SERVER['HTTP_USER_AGENT'],"Android");
  4. $palmpre = strpos($_SERVER['HTTP_USER_AGENT'],"webOS");
  5. $berry = strpos($_SERVER['HTTP_USER_AGENT'],"BlackBerry");
  6. $ipod = strpos($_SERVER['HTTP_USER_AGENT'],"iPod");
  7.  
  8. if ($iphone || $android || $palmpre || $ipod || $berry == true)
  9. {
  10. print "<iframe id=\"player\" width=\"425\" height=\"350\" src=\"http://www.youtube.com/embed/$youtube\" frameborder=\"0\"></iframe>";
  11. }
  12. else
  13. {
  14. print "<iframe id=\"player\" width=\"425\" height=\"350\" src=\"http://www.youtube.com/embed/zyE3ODy-tsk\" frameborder=\"0\"></iframe>";
  15. }
  16. ?>
RAW Paste Data