Redirect script

Started on the old forum in January 2010 · view the original in the archive · old links redirect here

#redirect #wap

3 replies · 550 views · started 16 years ago · 1 min read

3 participants
NickJR Newbie · 1 posts #1

Hi, i need a good redirect script web/wap

Ponick Developer · 216 posts #4

NickJR wrote: Hi, i need a good redirect script web/wap

<?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;

    }	

?>
/* I don't know everything hehe */

Find me on facebook

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