Wml To Xhtml Detect Redirect

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Wml To Xhtml Detect Redirect

    wif this script u put it in ur base folder and it will redirect xhtml browsers and pcs to web version and older phones to wml version jus put ur link in there for web n wap folder

    <?php

    global $userBrowser;

    // Your wapsite

    $wmllink = "http://siteaddress.com/wap/index.php";

    // Your website

    $htmllink = "http://siteaddress.com/web/index.php";


    //Detect the browser
    $userBrowser = $_SERVER[&#39;HTTP_USER_AGENT&#39;];


    //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, &#39;Mozilla&#39;))
    {
    $ub="PC";
    }
    //Check for msie
    else if(stristr($userBrowser, &#39;msie&#39;))
    {
    $ub="PC";
    }
    //Check for IE
    else if(stristr($userBrowser, &#39;internet explorer&#39;))
    {
    $ub="PC";
    }
    //Check for opera
    else if(stristr($userBrowser, &#39;opera&#39;))
    {
    $ub="PC";
    }
    //Check for Opera
    else if(stristr($userBrowser, &#39;Opera&#39;))
    {
    $ub="PC";
    }
    else
    {
    $ub="WML";
    }
    if($ub == "PC") {
    header("Location: ".$htmllink);
    exit;
    }
    else
    {
    header("Location: ".$wmllink);
    exit;
    }
    ?>

    #2
    cool!

    Comment


      #3
      thank you bro

      Comment

      Working...
      X