允许使用jquery从移动站点切换到完整站点

I have done some digging out here and am still a little unsure how to accomplish this. Here is the scenario:

I have a full HTML site that calls the following PHP code:

<?php
    require_once('inc/mobile_device_detect.php');
    mobile_device_detect(true,true,true,true,true,true,true,'mobile/',false);
?>
<!DOCTYPE html>
<html lang="en">
<head>blah blah</head>
etc...

The mobile_device_detect.php is a small library from http://detectmobilebrowsers.mobi/

So when I go to the full site from my mobile phone, the redirect happens perfectly. Next, on the mobile/index.html I have the following redirect code for those users that are wanting to see the full site (I should also mention that this mobile site uses jquery-mobile):

<a href="../index.html" data-ajax="false" rel="external"><img src="images/icons/world.png" width="32" height="32" alt="Full Site" class="ui-li-icon">Full Site</a>

When I click this link, I am resent back to the mobile page. I know this is happening because the redirect script is being fired again. I have tested this by visiting the mobile site with a desktop client and the redirect occurs perfectly.

Any ideas how I can remedy this for mobile users wanting to see the 'full site'?

You can append a query param on your href like href="../index.html?full=true" in your main page check that full param is not present.

<?php
    if (!isset($_GET['full'])) {
      require_once('inc/mobile_device_detect.php');
      mobile_device_detect(true,true,true,true,true,true,true,'mobile/',false);
    }
?>