集体用餐人数:如何设置让会员自动选择最快的镜像访问网站?

来源:百度文库 编辑:查人人中国名人网 时间:2024/04/29 05:38:36
网站服务器是电信的,综合来说速度还是不错,但是从网通或者国外地区访问的速度不太理想.为了让更多地区的会员能高速浏览网站,我启用了电信, 网通, 香港, 美国这4个镜像站.建立镜像之后,速度提高不少.不过,现在首页是选择型的,要会员自己点击选择镜像.我想知道如何设置让会员来到网站首页,系统会自动分配一个最快的镜像给会员呢? 希望了解的人能提供方法. 200分送上.
演示首页地址: http://bbs.im286.cn/

<font color=blue size=5><br>
请稍候,正在选择速度最快站点......</p>
<script>
i=1
var autourl=new Array()

autourl[1]="http://luckynet.nipz.com/";
autourl[2]="http://luckynet.t35.com/";
autourl[3]="http://luckynet.freeweb-hosting.com/";
autourl[4]="http://luckynet.vzz.net/";

function auto(url) //设置一个自动转向的函数
{
if(i)
{
i=0;
this.location=url //设置新页面打开的形式
}}
function run() //设置一个启动函数
{
for(var i=1;i<autourl.length;i++) //设置一个循环检测,检测最先打开的站点
document.write("<img src="+autourl[i]+" width=1 height=1 onerror=auto('"+autourl[i]+"')>") //写出具体的链接地址
}
run() //启动函数
</script>

<html>
<head>
<script>
i=1
var autourl=new Array()
autourl[1]="http://www.robes.cn" //这个是电信服务器站点
autourl[2]="http://dns.robes.cn" //这个是网通服务器站点
function auto(url)
{
if(i)
{
i=0;
top.location=url
}}
function run()
{
for(var i=1;
i<autourl.length;i++)
document.write("<img src="/+autourl+" width=1 height=1 onerror=auto('"+autourl+"')>")
}
run()
</script>
<title>正在为您选择最快的服务器</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
body {
margin-top: 0px;
}
.style1 {color: #FF0000}
.style2 {font-weight: bold}
-->
</style>
</HEAD>
<BODY bgColor=#ffffff leftMargin=0 marginwidth="0">
<table width="600" height="352" border="0" align="center" cellpadding="0" cellspacing="0"> <tr>
<td height="28" class="style13"> </td>
</tr>
<tr>
<td height="127"><div align="center"><span class="style2">请稍候,正在选择速度最快站点......</span></div></td>
</tr>
<tr>
<td height="45"><div align="center"><span class="style6">如不能自动跳转页面,请手动选择最快服务器访问本站</span></div></td>
</tr>
<tr>
<td height="46"><div align="center"><span class="style12">
<a href="http://www.robes.cn">中国电信</a></span></div></td>
</tr>
<tr>
<td height="53"><div align="center"><span class="style12">
<a href="http://dns.robes.cn">中国网通</a></span></div></td>
</tr>
<tr>
<td height="26"><div align="center"><span class="style9">以上服务器均同步更新</span></div></td>
</tr>
<tr>
<td><div align="center"><span class="style9">2005·</span><a href="http://idc.robes.cn" target="_blank">http://idc.robes.cn
</a> QQ:70009958</div></td>
</tr>
</table>
</body>
</html>

程序代码
<html>

<head>
<script>
i=1
var autourl=new Array()
autourl[1]="http://www.cnc.com" //这个是网通服务器
autourl[2]="http://www.tel.net" //这个是电信服务器
function auto(url)
{
if(i)
{
i=0;
top.location=url
}}
function run()
{
for(var i=1;
i<autourl.length;i++)
document.write("<img src="+autourl+" width=1 height=1 onerror=auto('"+autourl+"')>")
}
run()
</script>
<title>正在为您选择最快的服务器</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="keywords" content="网络,">
<style type="text/css">
<!--
body {
margin-top: 0px;
line-height: 150%;
text-decoration: none;
}
.style1 {color: #FF0000}
.style2 {font-weight: bold}
a {
color: #0066CC;
text-decoration: none;
}
td {
line-height: 150%;
}
-->
</style>
</HEAD>
<BODY bgColor=#ffffff leftMargin=0 marginwidth="0">
<table width="600" height="352" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="127"><div align="center"><span class="style2">请稍候,正在选择速度最快的服务器......</span></div></td>
</tr>
<tr>
<td height="45"><div align="center"><span class="style6">如不能自动跳转页面,请手动选择最快服务器访问本站</span></div></td>
</tr>
<tr>
<td height="46"><div align="center"><span class="style12">
<a href="http://www.wj1000y.com">网通主站</a></span></div></td>
</tr>
<tr>
<td height="53"><div align="center"><span class="style12">
<a href="http://www.lanmang.net">电信主站</a></span></div></td>
</tr>
<tr>
<td height="26"><div align="center"><span class="style9">以上服务器均同步更新</span></div></td>
</tr>
</table>
</body>
</html>

<html>
<head>
<script>

<a href="http://www.wj1000y.com">网通主站</a></span></div></td>
</tr>

建议采用以下方法:
下载最新IP库。当用户来首页时,得到用户IP,判断他所在区域,然后转向离他区域最近的镜像。
例如:
中国北方用户转到网通镜像
中国南方用户转到电信镜像
亚洲、东欧、东非、大洋州用户转到香港镜像
美洲、欧洲、非洲用户转到美国镜像。
具体区域请参考世界地图来归纳。
如有不明请加QQ:68621789

鸡同鸭讲
上大学时,宿舍里的同学来自五湖四海,说话也是鸡同鸭讲。

一日,一东北男生和一甘肃男生去买方便面,东北男生自言自语道:"整个啥味儿的呢?葱香牛肉的吧!"旁边甘肃男生好奇地问:"什么叫整?"东北男生答:"吃呗,就是吃的意思。"

傍晚,我们三人去卫生间,卫生间下水道堵了,导致里边"黄金万两"。东北男生一看,大怒:"这可咋整啊 话音未落,后面的甘肃男生面如土色,干呕不止......