iPad and iPhone Detection using PHP

Here is a php script which helps to detect the user agent easily.The PHP script uses the $_SERVER[‘HTTP_USER_AGENT’].

<?php
echo($_SERVER[‘HTTP_USER_AGENT’]);
?>

PHP script to detect iPad and redirecting to other page

<?php
    if(strstr($_SERVER['HTTP_USER_AGENT'],’iPad’))
  {
       header(‘Location: www.vishmax.com/contact/);
  }
 
?>

iPhone detection using PHP

<?php
     if(strstr($_SERVER['HTTP_USER_AGENT'],’iPod’))
   {
 
       header(‘Location: www.vishmax.com/blog/);
   }
 
?>

Related posts:

HTML5 page structure

HTML5 offers more powerful structure comparing to older versions of Html. There are many new …


Partner with Us

We are providing an exclusive partnership offer to individuals and companies who are interested in setting up their own web design & development company. For more information about how to partner with us, please contact us