View Single Post
Old 06-03-2010, 08:05 PM  
svzcom
Confirmed User
 
svzcom's Avatar
 
Industry Role:
Join Date: Jun 2007
Posts: 4,654
Here´s an exemple in php:


Code:
<?php
if(strstr($_SERVER['HTTP_USER_AGENT'],'Android') ||
   strstr($_SERVER['HTTP_USER_AGENT'],'webOS') ||
   strstr($_SERVER['HTTP_USER_AGENT'],'iPhone') ||
   strstr($_SERVER['HTTP_USER_AGENT'],'iPod')) {
  header('Location: http://www.google.com');
  exit;
}
?>

and one in javascript:


Code:
var uagent = navigator.userAgent.toLowerCase();
 if(uagent.indexOf('android') ||
    uagent.indexOf('webos') ||
    uagent.indexOf('iphone') ||
    uagent.indexOf('ipod')){
    document.location = 'http://www.google.com';
}
Hope this can help you
svzcom is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote