Fri 07 9 Feb
Detect WAP browser and redirect to different url in PHP
Posted in PHP, WAP by artofmobileDo you want to have the same url for your Web and Wap broswer? The following is the code to do so in PHP:
<?php
$htmlredirect = "http://www.artofmobile.com/index.html";
$wmlredirect = "http://www.artofmobile.com/index.wml";
$br='html';
if(preg_match("/wap/i",$HTTP_ACCEPT)) {
$br = "wml";
}
if($br == "wml") {
header("302 Moved Temporarily");
header("Location: ".$wmlredirect);
exit;
}
header("302 Moved Temporarily");
header("Location: ".$htmlredirect);
?>












