JS加ASP二級(jí)域名轉(zhuǎn)向的代碼
更新時(shí)間:2007年05月17日 00:00:00 作者:
自己做了asp的二級(jí)域名轉(zhuǎn)向已經(jīng)使用當(dāng)中,但用到另一種方法:前臺(tái)JS加ASP的轉(zhuǎn)向程序卻轉(zhuǎn)不了,程序調(diào)試已經(jīng)通過(guò)但不能轉(zhuǎn)向不知道為什么請(qǐng)幫忙指出原因,謝謝?。?!
<%
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]+"的二級(jí)域名。");
break;
}
}
else
{
whkFlag = 0;
window.alert("輸?shù)奶嗔耍?);
//window.location.href = "http://www.taofun.cn/";
}
}
else
{
whkFlag = 0;
window.alert("開頭請(qǐng)輸www");
//window.location.;
}
}
}
}
else
{
whkFlag = 0;
window.alert("去網(wǎng)站首頁(yè)!");
//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>
<%
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]+"的二級(jí)域名。");
break;
}
}
else
{
whkFlag = 0;
window.alert("輸?shù)奶嗔耍?);
//window.location.href = "http://www.taofun.cn/";
}
}
else
{
whkFlag = 0;
window.alert("開頭請(qǐng)輸www");
//window.location.;
}
}
}
}
else
{
whkFlag = 0;
window.alert("去網(wǎng)站首頁(yè)!");
//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>
相關(guān)文章
JavaScript字符串_動(dòng)力節(jié)點(diǎn)Java學(xué)院整理
JavaScript中的字符串就是用''或""括起來(lái)的字符表示。下面通過(guò)本文給大家介紹JavaScript字符串的相關(guān)知識(shí),感興趣的朋友一起看看吧2017-06-06BootStrap實(shí)現(xiàn)帶有增刪改查功能的表格(DEMO詳解)
這篇文章主要介紹了BootStrap實(shí)現(xiàn)帶有增刪改查功能的表格,表格封裝了3個(gè)版本,接下來(lái)通過(guò)本文給大家展示下樣式及代碼,對(duì)bootstrap增刪改查相關(guān)知識(shí)感興趣的朋友一起通過(guò)本文學(xué)習(xí)吧2016-10-10快速解決layui彈窗按enter鍵不停彈窗的問(wèn)題
今天小編就為大家分享一篇快速解決layui彈窗按enter鍵不停彈窗的問(wèn)題,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧2019-09-09微信小程序 bindtap 事件多參數(shù)傳遞的代碼示例
在微信小程序中,我們無(wú)法直接通過(guò) bindtap="handleClick(1,2,3)" 的方式傳遞參數(shù),而是通過(guò)自定義屬性data- 的方式傳遞,并在事件回調(diào)函數(shù)中通過(guò)event.currentTarget.dataset獲取這些參數(shù),本文給大家介紹小程序 bindtap 事件多參數(shù)傳遞的實(shí)例代碼,感興趣的朋友一起看看吧2023-12-12