Wml To Xhtml Detect Redirect

Started on the old forum in April 2007 · view the original in the archive · old links redirect here

2 replies · 903 views · started 19 years ago · 1 min read

linkrx7 #1

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['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; } ?>
Guest #3

thank you bro

Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close