7th Apr 2016, 12:50 PM | #1 |
Warrior Member Join Date: 2016
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
Hello everyone, I have issue with switching to desktop, I`m using Mobile_Detect.php script and detection for mobile is working fine, here is the code Code: inc.header.php (Desktop site) if ($_GET['v'] == 'desktop') { $_SESSION["v1"] = 'desktop'; } // Detect browser and redirect mobile users unless they've already opted out if ($_SESSION["v1"] != 'desktop') { // Place browser detection and redirection code here require_once 'Mobile_Detect.php'; $objMobile = new Mobile_Detect; if($objMobile ->isMobile()) { if($_SERVER['REQUEST_URI']=="/") { header('Location: http://www.website.com/m/'); } else { header("Location: http://www.website.com/m".$_SERVER['REQUEST_URI']); } exit; } } files : Code: inc.footer.php if ($_GET['v'] == 'desktop') { $_SESSION["v1"] = 'desktop'; } footer.html <a href="http://website.com/?v=desktop">Desktop version</a></div> Cheers Greg |
8th Apr 2016, 10:16 AM | #2 |
Warrior Member Join Date: 2016
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
Hey anyone can help ?
|
8th Apr 2016, 08:37 PM | #3 |
Warrior Member Join Date: 2016
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
|
Thanks rusilja! Yup, I'll definitely do some A/B testing when I have more visitors.
|
| |
Bookmarks |
Tags |
desktop, mobiledetectphp, switch |
| |