<%@ Language=VBScript %>
<!--#include virtual="/inc-freehost-function/FreeHostFunction.asp"-->
<!--#include virtual="/inc-freehost-function/FreeHostFunctionMain.asp"-->
<%fcon=Cstr(request.form)%>
<%if session("username")="" And session("agentusername")="" then
Response.Redirect "e.asp?e=可能超时了，请先登陆"
end if

if not ef then
If fcon="" then
	ef=True
	ec="保存信息时出错，请您重试一次。"
end if
end If

response.write "此页不再使用了"
response.End

'domain=jkjkjkjkjkjjk.com&year=1&password1=888888&password2=8888888&dns1=ns3.dns-diy.com&dns2=ns4.dns-diy.com&registrant_m=%D0%C7%CD%E2%BF%C6%BC%BC&registrant_e=star+out&r_org_m=%D0%C7%CD%E2%BF%C6%BC%BC&r_org_e=star+out&r_country_m=%D6%D0%B9%FA&r_country_e=CN&r_province_m=%B9%E3%B6%AB&r_province_e=GD&r_city_m=%B9%E3%D6%DD&r_city_e=GZ&r_address_m=%D6%D0%B2%DD%D2%A9%D6%D0%B2%DD%D2%A9%B5%C4%C8%CB&r_address_e=EAST+stree+231%23&r_postalcode=510666&r_telephone=%2B86.5925391800&r_email=test@fsdf.com&r_fax=%2B86.5925391808&administrant_m=%D0%C7%CD%E2%BF%C6%BC%BC&administrant_e=star+out&a_org_m=%D0%C7%CD%E2%BF%C6%BC%BC&a_org_e=star+out&a_country_m=%D6%D0%B9%FA&a_country_e=CN&a_province_m=%B9%E3%B6%AB&a_province_e=GD&a_city_m=%B9%E3%D6%DD&a_city_e=GZ&a_address_m=%D6%D0%B2%DD%D2%A9%D6%D0%B2%DD%D2%A9%B5%C4%C8%CB&a_address_e=EAST+stree+231%23&a_postalcode=510666&a_telephone=%2B86.5925391800&a_email=test@fsdf.com&a_fax=%2B86.5925391808&technician_m=%D0%C7%CD%E2%BF%C6%BC%BC&technician_e=star+out&t_org_m=%D0%C7%CD%E2%BF%C6%BC%BC&t_org_e=star+out&t_country_m=%D6%D0%B9%FA&t_country_e=CN&t_province_m=%B9%E3%B6%AB&t_province_e=GD&t_city_m=%B9%E3%D6%DD&t_city_e=GZ&t_address_m=%D6%D0%B2%DD%D2%A9%D6%D0%B2%DD%D2%A9%B5%C4%C8%CB&t_address_e=EAST+stree+231%23&t_postalcode=510666&t_telephone=%2B86.5925391800&t_email=test@fsdf.com&t_fax=%2B86.5925391808&billing_m=%D0%C7%CD%E2%BF%C6%BC%BC&billing_e=star+out&b_org_m=%D0%C7%CD%E2%BF%C6%BC%BC&b_org_e=star+out&b_country_m=%D6%D0%B9%FA&b_country_e=CN&b_province_m=%B9%E3%B6%AB&b_province_e=GD&b_city_m=%B9%E3%D6%DD&b_city_e=GZ&b_address_m=%D6%D0%B2%DD%D2%A9%D6%D0%B2%DD%D2%A9%B5%C4%C8%CB&b_address_e=EAST+stree+231%23&b_postalcode=510666&b_telephone=%2B86.5925391800&b_email=test@fsdf.com&b_fax=%2B86.5925391808&agreement=1


if session("selectedDomainName")="" then Response.Redirect "e.asp?e=注册信息已失效，请重新查询域名。"

If len(Request.form ("password1"))<6 Then
	ef=True
	ec="密码不能小于6位！"
elseif Application("onlyone")=true and Request.Form ("year")>1 then
	ef=True
	ec="管理员限制了首次注册只能注册一年！"
elseIf len(Request.form ("r_org_e"))<2 and len(Request.form ("r_cname"))<2 Then
	ef=True
	ec="注册人信息栏中的组织名称必须大于4个字符或1个汉字! "
elseIf len(Request.form ("a_org_e"))<2 and len(Request.form ("a_org"))<2 Then
	ef=True
	ec="管理人信息栏中的组织名称必须大于6个字符或3个汉字! "
elseIf len(Request.form ("t_org_e"))<2 and len(Request.form ("t_org"))<2 Then
	ef=True
	ec="技术联系人信息栏中的组织名称必须大于6个字符或3个汉字! "
elseIf len(Request.form ("b_org_e"))<2 and len(Request.form ("b_org"))<2 Then
	ef=True
	ec="付款联系人信息栏中的组织名称必须大于6个字符或3个汉字! "
'elseif replace(session("selectedDomainName"),Right(session("selectedDomainName"),"3"),"")<>Request.form ("domain") Then
'	ef=True
'	ec="非法修改! "&replace(session("selectedDomainName"),Right(session("selectedDomainName"),"3"),"")&" "&Request.form ("domain") 
end if


domtemp=Right(session("selectedDomainName"),"3")
if domtemp="com" or domtemp="net" or domtemp="org" then id=1
if domtemp=".cn" then id=2
if domtemp="biz" then id=4
if domtemp="nfo" then id=5
if domtemp=".cc" then id=8
domtemp2=replace(replace(session("selectedDomainName"),".",""),"-","")
if RegExpTest("[^A-Za-z0-9]",domtemp2) then'存在中文
id=6
if Right(domtemp2,"3")="com" or Right(domtemp2,"3")="net" then id=7
end if
if domtemp=".中国" or domtemp=".公司" or domtemp=".网络" then id=3

if not ef then
on error resume next
urllogin="https://cp.35.com/cgi-bin/chinese/login.cgi"
If TOLOGINDNS_CH_PRE(urllogin)=false then
If TOLOGINDNS_CH_PRE(urllogin)=false then
	ef=True
	ec="登陆域名接口失败，可能是网络忙的原因造成的，请再试一次，或请联系管理员。"
end if
end if
end if
'response.write fcon
'response.end
if not ef then

Dim enc
Enddomaintypeid=GetDomaintype(session("selectedDomainName"))


if id=1 then '.com
retdns=TOLOGINDNS_CH_POST_PRE("https://cp.35.com/cgi-bin/chinese/reg_direct_ocust2.cgi","https://cp.35.com/cgi-bin/chinese/reg_direct_ocust1.cgi",fcon)
elseif id=2 then '.cn
retdns=TOLOGINDNS_CH_POST_PRE("https://cp.35.com/cgi-bin/chinese/cn_reg_cust2.cgi","https://cp.35.com/cgi-bin/chinese/cn_reg_cust1.cgi",fcon)
elseif id=7 then '中文.com
retdns=TOLOGINDNS_CH_POST_PRE("https://cp.35.com/cgi-bin/chinese/reg_mul_domain.cgi","https://cp.35.com/cgi-bin/chinese/reg_mul_begin.cgi",fcon)
elseif id=3 then '中文.cn
retdns=TOLOGINDNS_CH_POST_PRE("https://cp.35.com/cgi-bin/chinese/reg_cn_domain.cgi","https://cp.35.com/cgi-bin/chinese/reg_cn_second.cgi",fcon)
end if

if retdns="" then
if id=1 then '.com
retdns=TOLOGINDNS_CH_POST_PRE("https://cp.35.com/cgi-bin/chinese/reg_direct_ocust2.cgi","https://cp.35.com/cgi-bin/chinese/reg_direct_ocust1.cgi",fcon)
elseif id=2 then '.cn
retdns=TOLOGINDNS_CH_POST_PRE("https://cp.35.com/cgi-bin/chinese/cn_reg_cust2.cgi","https://cp.35.com/cgi-bin/chinese/cn_reg_cust1.cgi",fcon)
elseif id=7 then '中文.com
retdns=TOLOGINDNS_CH_POST_PRE("https://cp.35.com/cgi-bin/chinese/reg_mul_domain.cgi","https://cp.35.com/cgi-bin/chinese/reg_mul_begin.cgi",fcon)
elseif id=3 then '中文.cn
retdns=TOLOGINDNS_CH_POST_PRE("https://cp.35.com/cgi-bin/chinese/reg_cn_domain.cgi","https://cp.35.com/cgi-bin/chinese/reg_cn_second.cgi",fcon)
end if
end if



if not (instr(retdns, "尚无资金帐户")>1 or instr(retdns, "帐户上只能支付")>1 or instr(retdns, "资金不足")>1) then
if instr(retdns, "注册成功")<1 then
	ef=True
dnsarry=split(retdns,"注册系统提示信息")

dnsarry2=split(replace(dnsarry(1),"</center></h2><hr>",""),"<hr>")
dnsarry2(0)=replace(dnsarry2(0),vbcrlf,"")
	ec=dnsarry2(0)
end if
end if


end if

'response.write retdns

if ef then
'response.write retdns
response.write cstr(ec)
'server.Transfer "e.asp"
'Response.Redirect "e.asp?e="&server.HTMLEncode (ec)
response.end
end if
%>
<%
Set conn=Server.CreateObject("ADODB.Connection")
	conn.Open Application("FreeHostDBlink")
Set dsdom = Server.CreateObject("ADODB.Recordset")
sql="Select * from FreeHost.FreeHost_Product_Domain"
	dsdom.Open sql,conn,1,3


dsdom.addnew
dsdom("username")=session("username")
dsdom("agent1")=session("agentname")

if session("agentusername")<>"" Then
dsdom("username")=session("agentusername")
dsdom("agent1")=session("agentusername")
End if

dsdom("Domain")=session("selectedDomainName")

If Enddomaintypeid=3 And Right(dsdom("Domain"),"7")=".net.cn" Then dsdom("Domain")=Replace(dsdom("Domain"),".net.cn",".网络")
If Enddomaintypeid=3 And Right(dsdom("Domain"),"7")=".com.cn" Then dsdom("Domain")=Replace(dsdom("Domain"),".com.cn",".公司")
If Enddomaintypeid=3 And Right(dsdom("Domain"),"3")=".cn" Then dsdom("Domain")=Replace(dsdom("Domain")&"_",".cn_",".中国")

dsdom("ServerlistID")=1
dsdom("Domaintype")=""
dsdom("status")="预注册成功"
dsdom("starttime")=NOW
dsdom("postcon")=fcon
dsdom("years")=Clng(request.form("year"))
if dsdom("years")<1 or request.form("year")="" then dsdom("years")=1
dsdom("inipass")=request.form("password1")
dsdom("Domain_API")=4
if Application("DNS_API")=1 then dsdom("DNS_API")=1
dsdom.update



'response.write dsdom("postcon")

dsdom.close
set dsdom=nothing
conn.close
set conn=nothing

if session("agentusername")<>"" Then%>

<!--#include virtual="/inc-freehost-function/htmlwrite.asp"--><%=htmlwrite("html5")%>　域名注册
<%=htmlwrite("html6")%>
<br><br>
<%if session("DomainNameModid")="" then%>
　　<a href="/agent/listmydomain.asp"><font color="#FF0000">预注册成功，马上付费>>></font></a><br><br>
<%else
%>
保存成功。
<%end if%>
<%=htmlwrite("html7")%>

<%else%>
<!--#include virtual="/inc-freehost-function/htmlwrite.asp"--><%=htmlwrite("html2")%>　域名注册
<%=htmlwrite("html3")%>
<br><br>
<%if session("DomainNameModid")="" then%>
　　<a href="/user/listmydomain.asp"><font color="#FF0000">预注册成功，马上付费>>></font></a><br><br>
<%else
%>
保存成功。
<%end if%>
<%=htmlwrite("html4")%>
<%End if%>
