<?php
error_reporting(E_ALL ^ E_NOTICE);
// 分析 HTTP_ACCEPT_LANGUAGE 的属性
// 这里只取第一语言设置 (其他可根据需要增强功能)
//搜索整理 www.jb200.com
preg_match('/^([a-z-]+)/i', $_SERVER['HTTP_ACCEPT_LANGUAGE'], $matches);
$lang = $matches[1];
switch ($lang) {
case 'zh-cn' :
header('Location: http://cn.jb200.com/');
break;
case 'zh-tw' :
header('Location: http://tw.jb200.com/');
break;
case 'ko' :
header('Location: http://ko.jb200.com/');
break;
default:
header('Location: http://en.jb200.com/');
break;
}
?>
<SCRIPT LANGUAGE="
javascript1.2">
<!--//
if (navigator.appName == ''Netscape'')
var language = navigator.language;
else
var language = navigator.browserLanguage;
if (language.indexOf(''en'') > -1) document.location.href = ''english.htm'';
else if (language.indexOf(''zh'') > -1) document.location.href = ''chinese.htm'';
else
document.location.href = ''english.htm'';
// End -->
</script>