如何用我的国际域名做虚拟域名?
时间:2010-06-16 09:53:00
如何用我的国际域名做虚拟域名?
config.asp
<%
Domain_URL = "intels.net"
' 域名
Ad = 0
' 是否有广告弹出
Fo = 0
' 是否使用框架
DBPath = "DRIVER={Microsoft Access Driver (*.mdb)};dbq=" &
Server.MapPath("Domain.Mdb")
CopyRight = "Asp之家"
' 版权信息
%>
default.asp
<%@ 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');h
qtpopup.location.href = 'Ad.Asp';</script>"
End If
If Fo=1 Then%>
<html>
<head>
<title>虚拟域名 - asp之家</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>
噢,您的浏览器不支持框架显示!
</body>
</noframes>
</html>
<%Else%>
<meta http-equiv="refresh" content="0;url=<%=URL%>">
<%End If%>
数据库domain.mdb结构:
user表
USER_ID USER_USERNAME USER_PWD USER_URL USER_EMAIL