二级域名的解析指向ASP源码
懂程序的人一看就明白怎么实现了
呵呵!真简单
<%@ LANGUAGE = VBScript.Encode %>
<%
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")
DBPath = Server.MapPath("data/url.mdb")
conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DBPath
SET rs = Server.CreateObject("ADODB.Recordset")
sql ="Select * From url where name=“"&user&"“"
rs.open sql,conn,1,2
if rs.eof or rs.bof then
response.write ("错误:找不到该页")
rs.close
conn.close
set rs=nothing
set conn=nothing
Else
url=rs("zurl")
rs.close
conn.close
set rs=nothing
set conn=nothing
%>
">
<%End If%>