Sanjoy Roy

[MCM, MCP, SCJP] – Senior PHP Programmer

PHP Mobile Detection Library


Download this ZIP: click MobileESP_Samples.zip

include("mp/php_redirect_sample/code/mdetect.php");
      $iphoneTierHomePage = 'http://m.xyz.com.au/index.php?page=m';
      $genericMobileDeviceHomePage = 'http://m.xyz.com.au/index.php?page=m';
      $desktopHomePage = 'index.php';
      $uagent_obj = new uagent_info();         
      function AutoRedirectToProperHomePage(){
	      global $uagent_obj, $iphoneTierHomePage, $genericMobileDeviceHomePage, $desktopHomePage; 
	      if ($uagent_obj->isTierIphone == $uagent_obj->true) 
          header ('Location: '.$iphoneTierHomePage);          
	      else if ($uagent_obj->DetectMobileQuick() == $uagent_obj->true) 
          header ('Location: '.$genericMobileDeviceHomePage);        
	      else 
          header ('Location: '.$desktopHomePage);
      }  
      AutoRedirectToProperHomePage();
Advertisements

Comments are closed.

%d bloggers like this: