|
可以自动判断用户是来自web上的还是手机用户,然后自动转向对应的网页。
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%> Dim strAccept strAccept=LCase(Request.ServerVariables("HTTP_ACCEPT")) '//获取手机相关的一些特性信息 If Instr(strAccept,"wap")>0 then Response.ContentType="text/vnd.wap.wml;charset=UTF-8" '将文件的格式转换成wml,编码为UTF-8 Response.Write ("<?xml version=""1.0"" encoding=""UTF-8""?>")&_
"<!DOCTYPE wml PUBLIC ""-//WAPFORUM//DTD WML 1.1//EN"" ""http://www.wapforum.org/DTD/wml_1.1.xml""> "&_
"<wml>"&_ "<head>"&_ "<meta http-equiv=""Cache-Control"" content=""max-age=0""/>"&_ "<meta http-equiv=""Cache-Control"" content=""no-cache""/>"&_ "</head>"&_ "<card id=""Redirect"" title=""转向WAP页面..."">"&_ "<onevent type=""onenterforward""><go href=""wap/index.asp""></go></onevent>"&_ "<p align=""left"">"&_ "<a href=""wap/index.asp"">马上进入...</a>"&_ "</p></card></wml>" <onevent type=""onenterforward""><go href=""wap/index.asp""></go></onevent>是让页面进入时自动转向wap/index.asp '//<a href=""wap/index.asp"">马上进入...</a>加上链接是防止一些手机无法自动跳转时可以点击链接进入 Else Response.Redirect ("http://www.wapforum.cn/index.htm") '//转想WEB首页的URL End If %>
|