Question: We have a redirect script on our site that detects mobile devices and redirects users to a subdomain which goes to the mobile site folder. But now we need a mechanism that gives the visitor a button on the page that then reloads the page and bypasses this check. The goal is if a smartphone user wants to see the full site, we need to give them a button to push to do so. So, the question is: is it possible to disable this script when user clicks on that button?

Answer: 
I beleive cookies are a more better solution since they will not go away when the page is changed.

Just make a cookie when the user clicks the button and send him to the mainsite.

How to make the cookie:\_

```
setcookie("fullsite", "SomeRandomThing", time()+60*60*24*30); // It will expire after a month

```

If the cookie is not set, then make it redirect.

```
if (!isset($_COOKIE['fullsite'])
{
  // redirect
}

```

Similarily make a button for the user to switch back and make that button delete the cookie.
yes you can. load script according to the button press.

```
if((!isset($_POST['button']) && mobiledevice==true))
{
         //put your redirection script here
}

```

use something like above