View file index.php

File size: 1.09Kb
<?php



global $userBrowser;



// Your wapsite



$wmllink = "wap/index.php";



// Your website



$htmllink = "web/index.php";





//Detect the browser

$userBrowser = $_SERVER['HTTP_USER_AGENT']; 





//echo $userBrowser;



if(strpos(strtoupper($HTTP_ACCEPT),"VND.WAP.XHTML+XML") > 0)

{

  $ub="pc";

}

else if(strpos(strtoupper($HTTP_ACCEPT),"XHTML+XML") > 0)

{

  $ub="pc";

}

//Check for Mozilla

else if(stristr($userBrowser, 'Mozilla')) 

{

  $ub="pc";

}

//Check for msie

else if(stristr($userBrowser, 'msie')) 

{

  $ub="pc";

}

//Check for IE

else if(stristr($userBrowser, 'internet explorer')) 

{

  $ub="pc";

}

//Check for opera

else if(stristr($userBrowser, 'opera')) 

{

  $ub="pc";

}

//Check for Opera

else if(stristr($userBrowser, 'Opera')) 

{

  $ub="pc";

}

else

{

  $ub="pc";

  }

if($ub == "pc") {

    header("Location: ".$htmllink);

    exit;

    }

    else 

    {

    header("Location: ".$wmllink);

    exit;

    }	

?>