盾怪网教程:是一个免费提供流行杀毒软件教程、在线学习分享的学习平台!

使用@字符完成二级域名系统

时间:2024/11/21作者:未知来源:盾怪网教程人气:

[摘要]利用@字符实现二级域名系统 不支持泛解析的域名同样也能做二级域名系统 dns.mdb数据库结构: 本例只用3字段,部分省略字段自己配合注册页面可以随便加 id(自动递增) user(文本) toru...

利用@字符实现二级域名系统


不支持泛解析的域名同样也能做二级域名系统

dns.mdb数据库结构:
本例只用3字段,部分省略字段自己配合注册页面可以随便加

id(自动递增)
user(文本)
torul(文本)
... ...


default.asp 页面内容
----------------------------------------------------------------------------------
<%
dim user
user=trim(request("user"))
if user="" then
%>
<script language="vbscript">
location.href="?user="&location.href
</script>
<%
else
user=replace(user,"http://","")
auser=instr(user,"@")
if auser>0 then
user=left(user,auser-1)
end if
mdbname="dns.mdb" 'dns.mdb为数据库存名
set conn=server.createobject("adodb.connection")
conn.open "dbq="&server.mappath(mdbname)&";driver={microsoft access driver (*.mdb)};"
set rs=server.createobject("adodb.recordset")
rs.open "select * from userdns where user='"&user&"'",conn,1,1
if not rs.eof then
tourl=rs("tourl")
else
tourl="index.asp" '改为默认的文档名
end if
rs.close
set rs=nothing
conn.close
set conn=nothing
response.redirect tourl
end if
%>
------------------------------------------------------------------------------------

IE地址栏输入: youname@dns.com就可通过default.asp进行域名转向 youname为用户名 dns.com为你网站的域名

关键词:运用@字符完成二级域名系统




Copyright © 2012-2018 盾怪网教程(http://www.dunguai.com) .All Rights Reserved 网站地图 友情链接

免责声明:本站资源均来自互联网收集 如有侵犯到您利益的地方请及时联系管理删除,敬请见谅!

QQ:1006262270   邮箱:kfyvi376850063@126.com   手机版