手机版 | 登陆 | 注册 | 留言 | 设首页 | 加收藏
当前位置: 网站首页 > 电脑知识 > 文章 当前位置: 电脑知识 > 文章

判断手机或电脑访问,并自动跳转

时间:2011-03-16    点击: 次    来源:网络    作者:不详 - 小 + 大

将这段加在你的默认首页文件中。
--------------------------------------------------------------------------------------------------------------------------------------------

/** 检测是否是移动设备访问 **/
require_once('mobile_device_detect.php');
mobile_device_detect(true,true,true,true,true,true,true,'http://wap.876543.net',false);

--------------------------------------------------------------------------------------------------------------------------------------------
以上的只能实现PHP程序的wap跳转,我再把我在网上找的目前可行的ASP程序的wap跳转发给大家

--------------------------------------------------------------------------------------------------------------------------------------------

<%
dim enterurl
if instr(Request.ServerVariables("http_accept"),"wap")>0  then 
    enterurl="http://wap.876543.net/"
'手机访问网站http://www.876543.net,自动跳转到http://wap.876543.net/
    response.redirect(enterurl)
    response.end   
else
         enterurl="http://www.876543.net/index.html"   
'电脑访问网站http://www.876543.net,自动跳转到/index.html
 response.redirect(enterurl)
 response.end 
end if
%>

--------------------------------------------------------------------------------------------------------------------------------------------

上一篇:自动识别WAP或WEB客户端浏览器并转入相应页面源码

下一篇:一句话足以识别手机或电脑访问,并转到相应的界面

凯立德2019冬季版更新..
粤ICP备13076123号  |   QQ:4805346  |  地址:Com  |  电话:92777708  |  
Copyright © 2024 天人文章管理系统 版权所有,授权Www.Qtxw.Com使用 Powered by 55TR.COM