So I\'m working on the mobile version of a site I\'m doing, and so far, I\'m pulling the mobile sites content from its main counterpart, the main site.
As I study s
First, go to the following URL and download the mobile_detect.php file:
http://code.google.com/p/php-mobile-detect/
Next, follow the instructions on the page, and upload the mobile_detect.php to your root directory, Insert the following code on your index or home page:
isMobile() && isset($_COOKIE['mobile']))
{
$detect = "false";
}
elseif ($detect->isMobile())
{
header("Location:http://www.yourmobiledirectory.com");
}
?>
You will notice that the above code is checking for a cookie called "mobile", this cookie is set when the mobile device is redirected to the mobile page. To set the cookie insert the following code on your mobile landing page:
View the full article at: http://www.squidoo.com/php-mobile-redirect