用ASP做“虚拟域名”的想法![1]
作者:未知 来源:未知 添加时间:2006-5-21 10:29:48--------------------------------------
<%@ LANGUAGE=VBScript%>
<%Response.Expires=0%>
<!-- #include file="Config.Asp" -->
<%Server_Name = Request.ServerVariables("SERVER_NAME")
For I=1 To Len(Server_Name)
If Mid(Server_Name,i,1)="." Then Exit For
USER = USER & Mid(Server_Name,i,1)
Next
Set Conn = Server.CreateObject("ADODB.Connection")
Conn.Open DBPath
Set Rs = Server.CreateObject("ADODB.Recordset")
Rs.Open "SELECT * FROM USER WHERE USER_USERNAME='" & USER & "'",Conn
If rs.bof Then
Rs.Close
Set Rs = Nothing
Conn.Close
Set Conn = Nothing
Response.Redirect "Main.Asp"
End If
URL = Rs("USER_URL")
Rs.Close
Set Rs = Nothing
Conn.Close
Set Conn = Nothing
If Ad=1 Then
Ad="<script language='JavaScript'>Popup = window.open('', 'Popupnav', 'width=200,height=150,resizable=0,scrollbars=auto');hqtpopup.location.href = 'Ad.Asp';</script>"
End If
If Fo=1 Then%>
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<frameset rows="0,*" cols="*" border=0 framespacing=0>
<frame name="Top" src="Top.Asp">
<frame name="Down" src="<%=URL%>">
</frameset>
<noframes>
<body>
<p>对不起,你的浏览器不支持框架!
</body>
</noframes>
</html>
<%Else%>
<meta http-equiv="refresh" content="0;url=<%=URL%>">
<%End If%>
站内搜索