设为首页 - 加入收藏
广告 1000x90
您的当前位置:主页 > 微商引流 > 引流技巧 > 正文

PHP之判断用户语言跳转网页

来源:网络分享 编辑:引流技巧 时间:2025-06-25
window.location.replace('url')
print("<meta http-equiv='refresh' content = '0;URL = eng/index.htm'>");
</script>


else
window.location.replace('url')
else
window.location.replace('url')
else if (lang == "zh-cn")

当来访者浏览器语言是中文就进入中文版面,国外的用户默认浏览器不是中文的就跳转英文页面。


var type=navigator.appName
if (type=="Netscape")
// 德语
else if (lang == "zh-tw")
else if (lang == "de")

var lang = lang.substr(0,2)
// 除上面所列的语言

<?

<script>
var lang = navigator.language
//cut down to first 2 chars of country code
print("<meta http-equiv='refresh' content = '0;URL = gb/index.htm'>");
window.location.replace('url')
// 简体中文
?>

if (lang == "en")
if ($lan == "zh-cn")

PHP代码:

$lan = substr(?$HTTP_ACCEPT_LANGUAGE,0,5);

HTML网页根据来访这的浏览器语言不同自动跳转多语言页面,在 <head> </head> 之间加入如下代码。


// 繁体中文
else
window.location.replace('url')
// 英语

var lang = navigator.userLanguage
栏目分类

微商引流技巧网 www.yinliujiqiao.com 联系QQ:1716014443 邮箱:1716014443@qq.com

Copyright © 2019-2024 强大传媒 吉ICP备19000289号-9 网站地图 rss地图

Top