Solved

How do I facilite a "full page" option on a mobile website?

Posted on 2014-01-31
2
199 Views
Last Modified: 2014-02-01
Here's the code that I have sitting on the desktop version of my site:

<?php
include 'Mobile_Detect.php';
$detect = new Mobile_Detect();
if ($detect->isMobile()) {
// Any mobile device.
header("Location:mobile/index.php");
exit();
}
?>

My client wants a button on the mobile version of the site that allows them to see the desktop version. How would I facilitate that if the "Mobile_Detect.php" file is automatically routing a mobile user to the mobile site?

I had a couple of ideas, but they all struck me as potentially convoluted, so I figured I would ask those who probably have already done this.

What do you think?
0
Comment
Question by:brucegust
2 Comments
 
LVL 58

Accepted Solution

by:
Gary earned 500 total points
ID: 39825674
In your button pass a parameter in the querystring of the url, have a check on page request for the querystring param and if set then use a session/cookie to hold the preference and only run your mobile detect if this is not set.
0
 

Author Comment

by:brucegust
ID: 39826224
That's what I was thinking, but didn't want to proceed without first checking to see if there was another option.

Thanks, Cathal!
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will explain how to display the first page of your Microsoft Word documents (e.g. .doc, .docx, etc...) as images in a web page programatically. I have scoured the web on a way to do this unsuccessfully. The goal is to produce something …
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
Learn how to match and substitute tagged data using PHP regular expressions. Demonstrated on Windows 7, but also applies to other operating systems. Demonstrated technique applies to PHP (all versions) and Firefox, but very similar techniques will w…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question