Solved

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

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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
comma true 6 37
Decrypt string by php 7 47
Number of hours between date in DB and now 8 21
SQL querys that gives me from one table into another. 2 24
This article discusses four methods for overlaying images in a container on a web page
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
This tutorial will teach you the core code needed to finalize the addition of a watermark to your image. The viewer will use a small PHP class to learn and create a watermark.

860 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