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