Technical Issues => Mobile Devices => Topic started by: admin on January 22, 2017, 09:17: PM

Title: Found something else we like for detecting a mobile device for a show if - else
Post by: admin on January 22, 2017, 09:17: PM
Download the mobile_detect.php file and place it where you want on your server.

Here's the show if scripting

 <?php include("mobile_script/Mobile_Detect.php");  // Check for any mobile device.
$detect = new Mobile_Detect(); ?>

<?php if ($detect->isMobile()) { ?>

   show if mobile

<?php } else {  ?>

   show if desktop

   <?php } ?>
Sorry, the copyright must be in the template.
Please notify this forum's administrator that this site is missing the copyright message for SMF so they can rectify the situation. Display of copyright is a legal requirement. For more information on this please visit the Simple Machines website.