When the visitor's browser language is Chinese, enter the Chinese page,Foreign users will default to English pages if their browser is not Chinese.

$lan=substr ( $http_accept_language, 0,5);
if ($lan == "zh-cn")
print ("<meta http-equiv =" refresh "content =" 0;url=gb/index.htm ">");
print ("&meta http-equiv =" refresh "content =" 0;url=eng/index.htm ">");

html pages automatically jump to multilingual pages depending on the browser language

In<head></head>Add the following code between.

The following is quoted:

var type=navigator.appname
if (type == "netscape")
var lang=navigator.language
var lang=navigator.userlanguage
//cut down to first 2 chars of country code
var lang=lang.substr (0,2)
if (lang == "en")
window.location.replace ("url")
//Simplified Chinese
else if (lang == "zh-cn")
window.location.replace ("url")
//traditional Chinese
else if (lang == "zh-tw")
window.location.replace ("url")
else if (lang == "de")
window.location.replace ("url")
//Except for the languages ​​listed above
window.location.replace ("url")
  • Previous Easily master Linux shutdown and restart commands
  • Next Analysis of Android File Manager (Project 1)