<%@ Language=VBScript %>
<!--#include virtual="/inc-freehost-function/xml.cls.asp"-->
<%
Function RegExpTest(patrn, strng)
  Dim regEx
  Set regEx = New RegExp
  regEx.Pattern = patrn
  regEx.IgnoreCase = False
  RegExpTest = regEx.Test(strng)
End Function
server.ScriptTimeout =240
session("DomainNameModid")=""


function checkinfo(vDomain)	

'On Error Resume Next 
 
vDomain=ComX.idntoac_7i24_com(Cstr(vDomain))
if CheckDomain(vDomain)="1" then
				   checkinfo=true
Else
	checkinfo=false
	If InStr(ECapi3,"520") Then Response.write " 代理号或密码错，或你的主控IP未在商务中国中授权。"
	If InStr(ECapi3,"532") Then Response.write " 你的主控IP未在商务中国中授权。"
		If ECapi3<>"" Then Response.write "出错:"&ECapi3
end if

end function

if request.form<>"" then
QueryString=cstr(request.form)
QueryString=replace(request.form,"searchedDomainName=","domain=")
QueryString=replace(QueryString,"&suffix=.com&","&com=yes&")
QueryString=replace(QueryString,"&suffix=.net&","&net=yes&")
QueryString=replace(QueryString,"&suffix=.org&","&org=yes&")
QueryString=replace(QueryString,"&suffix=.com.cn&","&comcn=yes&")
QueryString=replace(QueryString,"&suffix=.net.cn&","&netcn=yes&")
QueryString=replace(QueryString,"&suffix=.org.cn&","&orgcn=yes&")
QueryString=replace(QueryString,"&suffix=.gov.cn&","&govcn=yes&")
QueryString=replace(QueryString,"&suffix=.cn&","&cn=yes&")
QueryString=replace(QueryString,"&suffix=.biz&","&biz=yes&")
QueryString=replace(QueryString,"&suffix=.info&","&info=yes&")
QueryString=replace(QueryString,"suffix=cnaddr&","cnaddr=yes&")
response.Redirect "/style/info/actionbiz.asp?"&QueryString&"&big5=n"
end if

if instr(request.QueryString,"com=yes&")>1 then id=1
if instr(request.QueryString,"net=yes&")>1  or instr(request.QueryString,"org=yes&")>1 then id=30
if instr(request.QueryString,"cn=yes&")>1 then id=2
if instr(request.QueryString,"mobi=yes&")>1 then id=9
if instr(request.QueryString,"biz=yes&")>1 then id=4
if instr(request.QueryString,"info=yes&")>1 then id=5
if instr(request.QueryString,"cc=yes&")>1 then id=8
if instr(request.QueryString,"tv=yes&")>1 then id=10
if instr(request.QueryString,"hk=yes&")>1 then id=11
if instr(request.QueryString,"tw=yes&")>1 then id=12
'if request.QueryString("freehosttype")="2" then id=7
if request.QueryString("freehosttype")="3" then id=3
if request.QueryString("freehosttype")="4" then id=6

if instr(request.QueryString,"tel=yes")>1 then id=32
if instr(request.QueryString,"me=yes")>1 then id=31
if instr(request.QueryString,"asia=yes")>1 then id=21
if instr(request.QueryString,"govcn=yes")>1 then id=70

if instr(request.QueryString,"us=yes")>1 then id=27
if instr(request.QueryString,"co=yes")>1 then id=71
if instr(request.QueryString,"cm=yes")>1 then id=72
if instr(request.QueryString,"la=yes")>1 then id=52
if instr(request.QueryString,"im=yes")>1 then id=73
if instr(request.QueryString,"wang=yes")>1 then id=74
if instr(request.QueryString,"top=yes")>1 then id=75
if instr(request.QueryString,"xyz=yes")>1 then id=76
if instr(request.QueryString,"pw=yes")>1 then id=77
if instr(request.QueryString,"in=yes")>1 then id=24

if RegExpTest("[^A-Za-z0-9--]",trim(lcase(request.QueryString("domain")))) then'存在中文
if instr(request.QueryString,"com=yes&")>1 or instr(request.QueryString,"net=yes&")>1  or instr(request.QueryString,"org=yes&")>1 then id=7
if instr(request.QueryString,"mobi=yes&")>1 then id=16
if instr(request.QueryString,"biz=yes&")>1 then id=13
if instr(request.QueryString,"info=yes&")>1 then id=14
if instr(request.QueryString,"cc=yes&")>1 then id=15
if instr(request.QueryString,"tv=yes&")>1 then id=17
if instr(request.QueryString,"hk=yes&")>1 then id=18
if instr(request.QueryString,"tw=yes&")>1 then id=19
End if


Set conn=Server.CreateObject("ADODB.Connection")
	conn.Open Application("FreeHostDBlink")
	Set ds = Server.CreateObject("ADODB.Recordset")	
		Sql="Select * from FreeHost.FreeHost_DomainProductlist where id="&id
		ds.Open Sql,conn,1,1
if not ds.eof then
if ds("checkapi")<>3 then
if ds("checkapi")=1 then server.Transfer "domaincheckapi1.asp"
if ds("checkapi")=2 then server.Transfer "domaincheckpub.asp"
'if ds("checkapi")=3 then server.Transfer "actionbiz.asp"
'if ds("checkapi")=4 then server.Transfer "actionch.asp"
if ds("checkapi")=5 then server.Transfer "domainchecknet.asp"
if ds("checkapi")=6 then server.Transfer "domainchecknet.asp"
if ds("checkapi")=7 then server.Transfer "domainchecknet.asp"
end if
if ds("regapi")=1 then actionurl = "api1domainform.asp"
if ds("regapi")=2 then actionurl = "xindomainform.asp"
'if ds("regapi")=3 then actionurl = "actionbiz2.asp"
if ds("regapi")=4 then actionurl = "actionch2.asp"
if ds("regapi")=5 then actionurl = "netdomainform.asp"
end if
ds.close
set ds=nothing
conn.close
set conn=nothing
'if request.QueryString("freehosttype")="2" then Response.Redirect "e.asp?e=很抱歉，接口不支持注册这个类型"
'if request.QueryString("freehosttype")="3" then Response.Redirect "e.asp?e=很抱歉，接口不支持注册这个类型"'将支持
if request.QueryString("freehosttype")="4" then Response.Redirect "e.asp?e=很抱歉，接口不支持注册这个类型"
actionurl = "xindomainform.asp"
%>
<!--#include virtual="/inc-freehost-function/htmlwrite.asp"--><%=htmlwrite("html2")%>　域名注册
<%=htmlwrite("html3")%>
<form name="frmsearchedresult" action="<%=actionurl%>" method="post">
<%

'response.write request.QueryString

arryA=split(request.QueryString,"&")
for i=0 to ubound(arryA)
if right(arryA(i),4)="=yes" or instr(arryA(i),"suffix=")>0 Then
if instr(arryA(i),"=yes")>1 then domain=request.QueryString("domain")&"."&replace(arryA(i),"=yes","")
if instr(arryA(i),"suffix=")>0 then domain=request.QueryString("domain")&request.QueryString("suffix")
domain=replace(domain,".comcn",".com.cn")
domain=replace(domain,".netcn",".net.cn")
domain=replace(domain,".orgcn",".org.cn")
domain=replace(domain,".govcn",".gov.cn")
domain=replace(domain,".shcn",".sh.cn")
domain=replace(domain,".bjcn",".bj.cn")
domain=replace(domain,".gzcn",".gz.cn")
domain=replace(domain,".fjcn",".fj.cn")
domain=replace(domain,".jscn",".js.cn")
'domain=replace(domain,"%D6%D0%B9%FA","cn")
'domain=replace(domain,"%CD%F8%C2%E7","net.cn")
'domain=replace(domain,"%B9%AB%CB%BE","com.cn")
'response.write domain
'response.end
if instr(domain,".")>1 then
haveerr=false
ret=checkinfo(domain)


enddomain=ComX.actoidc_7i24_com(Cstr(domain))
enddomain=replace(enddomain,"%d6%d0%b9%fa","中国")
enddomain=replace(enddomain,"%cd%f8%c2%e7","网络")
enddomain=replace(enddomain,"%b9%ab%cb%be","公司")
if instr(enddomain,".")>1 then
if haveerr=false then
if ret=false then
%>　　　　 <a href="whois.asp?domain=<%=enddomain%>" target=_blank><font color=black><%=enddomain%> 已被注册</font></a><br>
<%else
canreg=true 
%>　　　<input type=radio name=selectedDomainName value="<%=enddomain%>" checked><%=enddomain%> 可以注册<br>
<%end if
end if
end if
end if
end if
next 
%>
<%if canreg=true then
%><br><br>


<%If Application("usercanselectapi")=True Then%>您可以自由选择域名的所属注册商：
<%If Application("api1")=True Then%>
新网互联：<input type="radio" name="usercanselectapi" value="1" checked>　
<%End if%>
<%If Application("api2")=True Then%>
新网：<input type="radio" name="usercanselectapi" value="2" checked>　
<%End if%>
<%If Application("api3")=True Then%>
商务中国：<input type="radio" name="usercanselectapi" value="3" checked>　
<%End if%>
<%If Application("api4")=True Then%>
中国频道：<input type="radio" name="usercanselectapi" value="4" checked>　
<%End if%>
<%If Application("api5")=True Then%>
万网：<input type="radio" name="usercanselectapi" value="5" checked>　
<%End if%>
<%If Application("api6")=True Then%>
API6：<input type="radio" name="usercanselectapi" value="6">　
<%End if%>
<%If Application("api7")=True Then%>
外国接口：<input type="radio" name="usercanselectapi" value="7">　
<%End if%>
<br><br>
<%End if%>

　　　<input type="submit" name="Submit" value="继续注册">
<%end if%>
<br>
<br>
<a href="javascript:history.back();">返回上一页重新查询</a><br>
</form>
<%=htmlwrite("html4")%>
