Solved

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

Posted on 2014-01-31
2
197 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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Both Easy and Powerful How easy is PHP? http://lmgtfy.com?q=how+easy+is+php (http://lmgtfy.com?q=how+easy+is+php)  Very easy.  It has been described as "a programming language even my grandmother can use." How powerful is PHP?  http://en.wikiped…
Deprecated and Headed for the Dustbin By now, you have probably heard that some PHP features, while convenient, can also cause PHP security problems.  This article discusses one of those, called register_globals.  It is a thing you do not want.  …
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 count occurrences of each item in an array.

758 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now