专注于互联网--专注于架构

最新标签
网站地图
文章索引
Rss订阅

首页 »Asp教程 » 二级域名:二级域名原理以及程序,申请即可开通 »正文

二级域名:二级域名原理以及程序,申请即可开通

来源: 发布时间:星期四, 2009年2月12日 浏览:117次 评论:0


::::::: 此属扬子原创 ::::::::::::::::::
\'::::::: 在sql20002000s中测试通过::::::::
\'::::::: 联系我:QQ:21112856Email:[email protected]:::::::::
\'::::::: http://www.tingfo.net ::::::

要达到 2级名效果必须下条件以及流程:
1、必须有个顶级域名而且此域名必须做好泛解析并做好指向
2、必须有台独立服务器泛解析域名指向该服务器
3、在服务器上IIS建个空主机头名web站点
4、将默认页面设置为你 2机解析(比如:freedns.asp)
5、 2级域名系列(包括申请页:shenqing.htm添加页add.asp,解析页)


优点:
a可以限制申请域名敏感字,比如 hacker,wwww,sex,china等
b, 可以限制申请域名非法字比如:!·#¥%……—*()——?‘“/等
c, 每个地址只能申请个域名
d限制申请域名长度
e, 如果用户所访问域名没人申请则转到特定页面本例中http://www.51bxg.com/miss.html
f, 申请了域名:***.yourname.com 可以同时支持:http://***.yourname.com 以及http://www.***.youranme.com 两个域名访问


下为系列代码:
shenqing.htm

<form action=adddns.asp method=post name=Frm _disibledevent=> 您想注册域名:
http://<inputname=\"nowurl\" size=12
style=\" BORDER-BOTTOM: 1px double; BORDER-LEFT: 1px double; BORDER-RIGHT: 1px double; BORDER-TOP: 1px double; COLOR: #000000; FONT-SIZE: 9pt\"> .51bxg.com
     <br>
你实际网站WebSite地址:
<inputname=\"tourl\" size=12
style=\" BORDER-BOTTOM: 1px double; BORDER-LEFT: 1px double; BORDER-RIGHT: 1px double; BORDER-TOP: 1px double; COLOR: #000000; FONT-SIZE: 9pt\">
你要求显示title:
<inputname=\"company\" size=12
style=\" BORDER-BOTTOM: 1px double; BORDER-LEFT: 1px double; BORDER-RIGHT: 1px double; BORDER-TOP: 1px double; COLOR: #000000; FONT-SIZE: 9pt\">


<br>
<input type=\"submit\" name=\"Submit\" value=\" 提 交 信 息 \" style=\"border:1px double rgb(88,88,88);font:9pt\">
  
<input type=\"re\" name=\"Re\" value=\" 重 新 填 写 \" style=\"border:1px double rgb(88,88,88);font:9pt\">
</p>
</form>



添加记录页面add.asp
<!--# file=\"char.inc\"-->
<!--# file=\"conn.asp\"-->
<%
uID=request.cookies(\"*****\")
%>
<%
dim nowurl,tourl,company,along,pbkey
nowurl=trim(request.form(\"nowurl\"))+\".51bxg.com\"
nurl=trim(request.form(\"nowurl\"))
tourl=trim(request.form(\"tourl\"))
company=trim(request.form(\"company\"))
along=20
pbkey=\"www,sex,admin,w,ww,wwww,hacker,hack\"


rs=server.createobject(\"adodb.record\")
sql=\"select * from dns where userid=\'\"&uid&\"\'\"
rs.open sql,conn,1,1
not rs.EOF then
response.write\"很抱歉你已经申请过 2级域名每个用户只能申请个 2级域名!<br>你申请 2级域名是:http://\"+rs(\"nowurl\")
response.end
end


rs=server.createobject(\"adodb.record\")
sql=\"select * from dns where nowurl=\'\"&nowurl&\"\'\"
rs.open sql,conn,1,1
not rs.eof then
response.write\"很抱歉你申请域名:http://\"+nowurl+\"已经被其他公司申请请另外申请域名\"
response.end
end

len(nurl)>along then
response.write\"很抱歉你输入域名太长请重新输入\"
response.end
end

instr(pbkey,nurl) then
response.write\"很抱歉你输入域名含有敏感字而不管理员屏蔽请重新输入\"


response.end
end

\'判断合法性
instr(nurl,\"~\") or instr(nurl,\"`\") or instr(nurl,\"/\") or instr(nurl,\"?\") or instr(nurl,\">\") or instr(nurl,\"<\") or instr(nurl,\";\") or instr(nurl,\":\") or instr(nurl,\"}\") or instr(nurl,\"{\") or instr(nurl,\")\") or instr(nurl,\"(\") or instr(nurl,\"*\") or instr(nurl,\"&\") or instr(nurl,\"^\") or instr(nurl,\"%\") or instr(nurl,\".\") or instr(nurl,\",\") or instr(nurl,\"\'\") or instr(nurl,\"~\") or instr(nurl,\"!\") or instr(nurl,\"$\") then
response.write\"很抱歉你输入域名含有非法请重新输入以下为非法:<br>~ ` / ? > < ; : } { ) ( * & ^ % $ # @ !\"
response.end
end


rs=server.createobject(\"adodb.record\")
sql=\"select * from ** where theid is null\"
rs.open sql,conn,3,3
rs.add
rs(\"userid\")=uID
rs(\"nowurl\")=nowurl
rs(\"tourl\")=tourl
rs(\"company\")=company
rs.update
response.write\"祝贺申请成功你马上就可使用你域名:http://\"+nowurl
%>



域名解吸: freedns.asp
<!--# file=\"conn.asp\"-->
<%
dim geturl
geturl=replace(Request.ServerVariables(\"HTTP_HOST\"),\"www.\",\"\")

rs=server.createobject(\"adodb.record\")
sql=\"select * from tb where nowurl=\'\"&geturl&\"\'\"
rs.open sql,conn,1,1
rs.eof then
response.redirect\"http://www.51bxg.com/miss.html\"

dim tourl,company
tourl=rs(\"tourl\")
company=rs(\"company\")
%>
<HTML>
<HEAD>
<META http-equiv=\"Content-Type\" content=\"text/html; char=gb2312\">
<META CONTENT=\"text/html; CHARSET=UTF-8\" HTTP-EQUIV=\"Content-Type\">
<TITLE><% =company %></TITLE>
</HEAD>


<frame frameborder=\"0\" framespacing=\"0\" scrolling=\"no\" border=\"0\" marginheight=\"0\" marginwidth=\"0\" rows=\"0,*\">
<frame scrolling=\"NO\" noresize=\"0\" marginwidth=\"0\" marginheight=\"0\" framespacing=\"0\" frameborder=\"0\" target=\"\" name=\"\" SRC=\"about:blank\">

<frame scrolling=\"yes\" noresize=\"0\" marginwidth=\"0\" marginheight=\"0\" framespacing=\"0\" frameborder=\"0\" target=\"\" name=\"\" SRC=\"<% =tourl %>\">

<noframes>
<body>
<p>This page uses frames, but your browser doesn\'t support them.</p></body>
</noframes>
</frame>
</HTML>
<% end %>
0

相关文章

读者评论

发表评论

  • 昵称:
  • 内容: