Skip to main content

Creating a "show desktop website" button for your mobile site

Posted on April 8, 2011 by Anthony James Founder/CEOAnthony James Founder/CEO


It’s good practice to give your website users the ability to choose between using the mobile version and the desktop version. In this tut we use PHP and jQuerymobile to accomplish this task. We will create a session and store the preference and use PHP to detect mobile browsers by their user agent.

Download source .zip



4 Comments

Image of Ghansham
Ghansham
8 years ago

hi anthony, u doing a great job, hope to see more interesting jqmobile tutorials.

Image of Kate
Kate
8 years ago

Hi Anthony,
I’ve got a question in regards to this, is there an email I can contact you on. Kind regards,
Kate

Image of Greg
Greg
7 years ago

I would like to use this exactly as you have it with one modification: When a mobile device is first detected, I would like to ask them if they want the mobile version or the site or the desktop version.
This would seem easy but I cant seem to get my head around it.
Greg

Image of Shahab
Shahab
7 years ago

hi, for some reason i get a loop when trying to switch from mobile to desktop. I’m using the same code. any idea why this would happen?

Leave a Reply

Your email address will not be published. Required fields are marked *