Posted By

robnilas on 01/21/17


Tagged

mobile-redirection


Versions (?)

Detecting and Redirecting Mobile Users


 / Published in: PHP
 

  1. <? if (
  2. stristr($ua, "Windows CE") or
  3. stristr($ua, "Mobile") ) {
  4. $DEVICE_TYPE="MOBILE";
  5. }
  6. if (isset($DEVICE_TYPE) and $DEVICE_TYPE=="MOBILE") {
  7. $location='YOUR-MOBILE-SITE.com/index.php';
  8. header ('Location: '.$location);
  9. }
  10. ?>

Report this snippet  

You need to login to post a comment.