JS plus asp two-level domain name to the code _javascript skills

Source: Internet
Author: User
Do the ASP's two-level domain name has been used in the use of, but the use of another method: the front desk JS plus ASP's steering program is not, the program debugging has passed but can not turn to do not know why please help point out why, thank you!!!
<%
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=" &AMP;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 as 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 ("&LT;BR&GT;WHKURL2:" +whkurl2);
if (whkurl2.tolowercase () = = "www")
{
if (Whkurl.indexof (".", whkfirstp+1) = = Whkurl.lastindexof (".", WhkEndP-1))
for (i=0;i<whkcoun;i++)
{
document.write ("<br> here is read 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 ("Find" +records[i][0]+ level two domain name.) ");
Break
}
}
Else
{
Whkflag = 0;
Window.alert ("Lost too much!") ");
Window.location.href = "http://www.taofun.cn/";
}
}
Else
{
Whkflag = 0;
Window.alert ("At the beginning please lose www");
Window.location.href= "http://www.taofun.cn/";
}
}
}
}
Else
{
Whkflag = 0;
Window.alert ("Go to the homepage of the website!");
Window.location.href = Whkurl;
}
document.write ("<br> final Result:" +GOTOURL+WHKWHKWHK);
if (Whkflag = 1)
{
document.write ("<frameset cols=\" *\ "><frame frameborder=\" 0\ "scrolling=\" auto\ "src=\" "+gotoUrl+" \ "> <\/frameset> ");
}
</script>
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.