[作者]yezhan http://www.okhtm.com
来源:[邪八]
default.htm
domain.asp
domain=request.querystring("domain")
username = mid(domain,8,instr(domain,"@")-8)
if not check_user(username) then
url="reg.asp?Err_Msg_id=1"
else
set rs=server.createobject("adodb.recordset")
sql="select homepage,hits from domain where username='" & username & "'"
rs.open sql,conn,1,3
if rs.bof or rs.eof then
url="reg.asp?Err_Msg_id=1"
else
url=rs("homepage")
end if
rs.close
set rs=nothing
end if
conn.close
set conn=nothing
response.redirect url
response.end
function check_user(str)
check_user=true
checkstr="abcdefghijklmnopqrstuvwxyz0123456789_"
for i=1 to len(str)
if instr(checkstr,mid(str,i,1))<=0 then
check_user=false
exit for
end if
next
end function
%>
流程:
default.htm进行判断,也可以是index.htm,但是一定要是这两个中一个,因为他们在目录里优先级是比default.asp或者index.asp高的
然后判断完毕后再进行二级前缀的判断,如果数据库中存在的话就直接转向该地址,如果不存在的话就转向default.asp或者index.asp