Level two domain name principles and procedures, application can be opened [ordinary frame-type level two domain name]
To achieve the two-level name effect, you must have the conditions and procedures:
1, must have a top-level domain name, and this domain name must do a pan-resolution and do a good job pointing.
2, must have a stand-alone server. A generic resolved domain name points to the server.
3, on the server, IIS to build a blank host header names of the Web site.
4, the default page set to your two-machine resolution program (for example: freedns.asp)
5, Level two domain name series of procedures (including application page: shenqing.htm, add page add.asp, parse page,)
Advantages of this program:
A, you can limit the application of the domain name sensitive words, such as Hacker,wwww,sex,china, etc.
b, you can limit the application of the domain name of the illegal word, such as:! #¥%......-* ()-? ' "/etc
C, only one domain name can be applied to each address.
D, limit the length of the application domain,
E, if the user visited the domain name no one to apply to go to a specific page, in this case http://www.51bxg.com/miss.html
F, the application of domain name: ***.yourname.com can also support: http://***.yourname.com and http://www.***.youranme.com two domain access.
For a series of program code:
Shenqing.htm
<form action=adddns.asp method=post name=frm onsubmit= "return Check_input ()" > <br> <font color=red> Plus * Must fill in the content </font> <br>
The domain name you want to register:
Http://<input name= "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>
Your actual website address:
<input name= "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 ">
The title you want to display:
<input name= "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= "Submission Information" style= "border:1px double rgb (88,88,88); font:9pt" >
<input type= "reset" name= "reset" value= "re-fill" style= "border:1px double rgb (88,88,88); font:9pt" >
</p>
</form>
Add a record page add.asp
<!--#include file= "Char.inc"-->
<!--#include 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"
Set Rs=server.createobject ("Adodb.recordset")
Sql= "SELECT * from DNS where userid= '" "&uid&" "
Rs.Open sql,conn,1,1
If not Rs. EOF Then
Response.Write "I am sorry, you have applied for a level two domain name, each user can only apply for a two-level domain name!" <br> The two domain name you apply for is: http://"+rs (" Nowurl ")
Response.End
End If
Set Rs=server.createobject ("Adodb.recordset")
Sql= "SELECT * from DNS where nowurl= '" "&nowurl&" "
Rs.Open sql,conn,1,1
If not rs.eof then
Response.Write "Sorry, you apply for domain name: http://" +nowurl+ "has been applied by other companies, please apply for another domain name. "
Response.End
End If
If Len (nurl) >along Then
Response.Write "Sorry, the domain name you entered is too long, please re-enter"
Response.End
End If
If InStr (Pbkey,nurl) Then
Response.Write "I'm sorry, you entered the domain name because it contains sensitive words without the Administrator screen, please re-enter." "
Response.End
End If
' Judge the legality of character
If 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 "Sorry, you entered the domain name contains illegal characters, please re-enter, the following characters are illegal characters: <br>~ '/?" > <; :} {) (* & ^% $ # @! "
Response.End
End If
Set Rs=server.createobject ("Adodb.recordset")
Sql= "SELECT * from * * where Theid is null"
Rs.Open sql,conn,3,3
Rs.addnew
RS ("userid") =uid
RS ("Nowurl") =nowurl
RS ("Tourl") =tourl
RS ("Company") =company
Rs.update
Response.Write "Congratulations, apply successfully, you can immediately use your domain name: http://" +nowurl
%>
Domain name desorption procedure: freedns.asp
<!--#include file= "conn.asp"-->
<%
Dim Geturl
Geturl=replace (Request.ServerVariables ("Http_host"), "www.", "" "
Set Rs=server.createobject ("Adodb.recordset")
Sql= "SELECT * from TB where nowurl= '" &geturl& ""
Rs.Open sql,conn,1,1
If Rs.eof Then
Response.Redirect "Http://www.51bxg.com/miss.html"
Else
Dim Tourl,company
Tourl=rs ("Tourl")
Company=rs ("Company")
%>
<HTML>
<HEAD>
<meta http-equiv= "Content-type" content= "text/html; charset=gb2312 ">
<meta content= "text/html; Charset=utf-8 "http-equiv=" Content-type ">
<title><% =company%></title>
</HEAD>
<frameset 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= "main" Name= "main" src= "About:blank" >
<frame scrolling= "yes" noresize= "0" marginwidth= "0" marginheight= "0" framespacing= "0" frameborder= "0" target= "main "Name=" main "src=" <% =tourl%> ">
<noframes>
<body>
<p>this page uses frames, but your browser doesn ' t support them.</p></body>
</noframes>
</frameset>
</HTML>
<% End If%>