View Full Version : xhtml/wml
jay32
05-26-2008, 01:58 AM
im surprised at how many new mobile phones, can not detect the correct browser to open when it comes to xhtml, I found when doing a number of tests, That a standard .mobi xhtml index.php page, would try an open in a wml browser considering all the phones in question had a xhtml browser built in.
jay32
05-26-2008, 02:14 AM
This is a right pain, as ive now got to move everything to place a redirect, b4 my site index page GRR lol..
I found this bit of coding for a redirect between xhtml and wml. Hopefully this will help.
<?php
global $userBrowser;
// Your wapsite
$wmllink = "wap/index.php";
// Your website
$htmllink = "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="WML";
}
if($ub == "PC") {
header("Location: ".$htmllink);
exit;
}
else
{
header("Location: ".$wmllink);
exit;
}
?>
If anyone else has any other ideas for a xhtml/wml redirect, It would be appreciated. Thanks
Powered by vBulletin® Version 4.1.10 Copyright © 2012 vBulletin Solutions, Inc. All rights reserved.