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();

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: