在wap网站制作过程中,你想要知道客户端的浏览方式,通过判断转向web网站或者wap网站
asp代码
<%
'+--------------------------------------------------------+
'| 识别WAP或WEB客户端浏览器 (asp版本)
'| 作者: 东方皓 (hxroyal@163.com | www.wangzhengdong.com)
'+--------------------------------------------------------+
Option Explicit
dim GuestUrl
if instr(Request.ServerVariables("http_accept"),"wap")>0 then
GuestUrl="http://WAP网站地址"
else
GuestUrl="http://WEB网站地址"
end if
Response.Redirect(GuestUrl)
%>
php代码
<?php
/*
'+--------------------------------------------------------+
'| 识别WAP或WEB客户端浏览器 (asp版本)
'| 作者: 东方皓 (hxroyal@163.com | www.wangzhengdong.com)
'+--------------------------------------------------------+
*/
$GuestIE = $_SERVER['HTTP_ACCEPT'];
if(strpos($GuestIE,"wap")>0)
{
header("location:http://WAP网站地址");
}
else
{
header("location:http://WEB网站地址");
}
?>