I’m using mobiledetect.net to render a mobile version of my site {m.mysite.com) but now tablets are so popular, I want the desktop site to load on such devices - what do I need to change?
This is the code I currently have at the top of my desktop version:
<?php
@include("Mobile_Detect.php");
$detect = new Mobile_Detect();
if ($detect->isMobile() && isset($_COOKIE['mobile']))
{
$detect = "false";
}
elseif ($detect->isMobile())
{
header("Location:http://m.mysite.com");
}
?>
I’ve read that I need to add this:
if ($detect->isMobile() && !$detect->isTablet())
Bu I’m not sure how to implement it with the cookie control I have?