国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > JavaScript > 正文

JS加ASP二級域名轉(zhuǎn)向的代碼

2019-11-21 02:04:37
字體:
供稿:網(wǎng)友
自己做了asp的二級域名轉(zhuǎn)向已經(jīng)使用當中,但用到另一種方法:前臺JS加ASP的轉(zhuǎn)向程序卻轉(zhuǎn)不了,程序調(diào)試已經(jīng)通過但不能轉(zhuǎn)向不知道為什么請幫忙指出原因,謝謝?。?!
<%
Dim whkDbq,whkSql,whkRs,whkCount
Set whkConn = Server.CreateObject("ADODB.Connection")
whkDbq = Server.MapPath("SqlTaoFun.mdb")
whkConn.Open"Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&whkDbq
whkSql = "select bh,id from UserInfo where State='3'"
Set whkRS = Server.CreateObject("ADODB.Recordset")
whkRs.open whkSql,whkConn,3,3
%>
<script language="javascript">
var records = [],whkCoun = 0,whkFlag = 0;
<%
Do while not whkRs.Eof
%>
records[whkCoun] = new Array("<%=whkRs("bh")%>","<%=whkRs("id")%>");
document.write("whkCoun:"+whkCoun+"    records["+whkCoun+"]:"+records[whkCoun][0]+records[whkCoun][1]+"<br>");
whkCoun = whkCoun + 1;
<%
whkRs.MoveNext
'whkConn = whkConn + 1
Loop
'Response.End()
%>
whkUrl = document.location.href;
document.write(whkUrl)
whkUrl = whkUrl.replace("http://","");
whkUrl = whkUrl.substring(0,whkUrl.indexOf("/"));
document.write("<br>whkUrl:"+whkUrl);
if (whkUrl.toLowerCase() != "www.taofun.cn")
       {
       var whkFirstP = whkUrl.indexOf("."),whkEndP = whkUrl.lastIndexOf("."),gotoUrl;
       if ((whkFirstP == whkEndP) && ((whkFirstP != -1) || (whkEndP != -1)))
              {
              whkFlag = 0;
              window.alert("taofun.cn");
              //window.location.href = "http://www.taofun.cn/"
              }
       else
              {
                     if (whkUrl == "localhost")
                     {
                            whkFlag = 0;
                            window.alert("localhost");
                     }
                     else
                     {

                     var whkUrl2 = whkUrl.substring(0,whkUrl.indexOf("."));
                     document.write("<br>whkUrl2:"+whkUrl2);
                     if (whkUrl2.toLowerCase() == "www")
                            {
                            if (whkUrl.indexOf(".",whkFirstP+1) == whkUrl.lastIndexOf(".",whkEndP-1))
                                   for(i=0;i<whkCoun;i++)
                                   {
                                          document.write("<br>這里是讀取的bh:"+records[i][0]);
                                          if (records[i][0] == whkUrl.substring(whkFirstP+1,whkUrl.indexOf(".",whkFirstP+1)))
                                                 {
                                                 whkFlag = 1;
                                                 gotoUrl = "http://www.taofun.cn/show/Shop.asp?id="+records[i][1];
                                                 window.alert("找到"+records[i][0]+"的二級域名。");
                                                 break;
                                                 }
                                   }
                            else
                                   {
                                   whkFlag = 0;
                                   window.alert("輸?shù)奶嗔耍?);
                                   //window.location.href = "http://www.taofun.cn/";
                                   }
                            }
                     else
                            {
                            whkFlag = 0;
                            window.alert("開頭請輸www");
                            //window.location.;
                            }
                     }
              }
       }
else
       {
       whkFlag = 0;
       window.alert("去網(wǎng)站首頁!");
       //window.location.href = whkUrl;
       }
document.write("<br>最后結(jié)果:"+gotoUrl+whkwhkwhk);
if (whkFlag == 1)
{
document.write("<frameset cols=/"*/"><frame frameborder=/"0/" scrolling=/"auto/" src=/""+gotoUrl+"/"><//frameset>" );
}
</script>
發(fā)表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發(fā)表
主站蜘蛛池模板: 灯塔市| 上蔡县| 肇源县| 鹤峰县| 香港 | 中牟县| 余干县| 五寨县| 普定县| 襄汾县| 蒙山县| 日土县| 布尔津县| 德阳市| 马山县| 莱西市| 中阳县| 东台市| 柯坪县| 合川市| 广水市| 抚顺市| 忻城县| 光泽县| 安岳县| 泽普县| 赞皇县| 闸北区| 宜州市| 北海市| 克东县| 靖安县| 临沂市| 枞阳县| 阳谷县| 东台市| 诸暨市| 龙川县| 江门市| 潼关县| 左权县|