ASP implements database interface code for domain name query
<%
on error resume next
Private d_exsit
Dim Retrieval
Dim Domain
Dim TakenHTML
Function GetURL(url)
Set Retrieval = Server.CreateObject(Microsoft.XMLHTTP)
With Retrieval
.Open GET, url, False, ,
.Send
GetURL = .ResponseText
End With
Set Retrieval = Nothing
End Function
Domain = Replace(Request.Form(domain),www.,) & . & Request.Form(ext)
if Domain=.com or Request.Form(domain)= then
Response.Write (<script>alert( 'Look what you forgot to fill in? Didn't you fill in the domain name? ');javascript:history.back(1)</script>)
response.end
end if
'TakenHTML = GetURL()
TakenHTML = GetURL(= & Domain)
d_exsit=1
if InStr(TakenHTML,No entries) > 1 then
Response.Write Domain & An error occurred, please return! <br><br>
else
if InStr(TakenHTML,No match) > 1 then %>
Congratulations, the domain name <% =Domain %> you want to register has not been registered yet <p>< a href=# onClick=MM_openBrWindow( '../formmail/domain.htm ', ' ', 'scrollbars=auto,width =500,height=500 ')>
Click here to start registering your domain name</a></p></font>
<% else %>
<font color=red& gt;<br>Sorry</font> The domain name <% =Domain %> you want to register has already been registered! <p></p>Please change the domain name and try again</font>
<form method=post action=search.asp name=checkdomain id=Form1>
type=text name=domain id=Text1>
<select name=ext id=Select1>
<option value=com selected>.com</option>
<option value=net>.net</option>
<option value=org>.org</option>
<option value=com.cn>.com.cn</option>
<option value=net.cn>.net.cn</option>
<option value=org.cn>.org.cn</option>
<option value=cc>.cc</option>
<option value=tv>.tv</option>
<option value=biz>.biz</option>
<option value=info>.info</option>
</select>
<input type=submit name=Submit value= query id=Submit1 onClick = return submitchecken();>
</form>The following is the detailed registration information for this domain name<BR></font>
<table><tr><td><PRE><% =dowith() %></PRE></td></tr></table></font>
<% end if
end if
Function dowith()
Dim lStrURL
Dim pagebefore
Dim pageafter
Dimtempcontent
Dim pagestart
Dim pageend
dim temps
pageafter = <PRE>
pagebefore = </PRE>
tempcontent = TakenHTML
if d_exsit<>0 then
pagestart = InStr(1,tempcontent, pageafter,1)
If pagestart = 0 Then
dowith = <font color=red>Unexpected error 2!</font>
d_exsit = 3
Exit Function
Else
pagestart = pagestart + Len(pageafter) + 1
pageend = InStr(pagestart, tempcontent, pagebefore,1)
If pageend = 0 Then
dowith = <font color=red>Unexpected error!</font>
d_exsit = 3
Exit Function
Else
pageend = pageend - pagestart 'Get the content length
tempcontent = Mid(tempcontent, pagestart, pageend)
End If
End If
Set pageregexp = New RegExp
pageregexp.Global = True
pageregexp.Pattern = <[^>]*>
tempcontent = pageregexp.Replace(tempcontent, )
Set pageregexp = Nothing
dowith=tempcontent
End If
End Function
%>