Solved

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

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
I imagine that there are some, like me, who require a way of getting currency exchange rates for implementation in web project from time to time, so I thought I would share a solution that I have developed for this purpose. It turns out that Yaho…
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.

867 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

15 Experts available now in Live!

Get 1:1 Help Now