<%@ Language=VBScript %>
<!--#include virtual="/inc-freehost-function/FreeHostFunction.asp"-->
<!--#include virtual="/inc-freehost-function/FreeHostFunctionMain.asp"-->
<%
Function CLen(HzStr)
L = len(HzStr)
For n=1 to L
If Asc(mid( HzStr,n,1))<0 Then HzNum = HzNum + 1
Next
Clen = L + HzNum
End Function
for each item in Request.Form
if instr(Request.Form(item),"'")>0 then response.Redirect "e.asp?e=出错，请不要输入'字符："&Request.Form(item) 
if instr(Request.Form(item),"&")>0 then response.Redirect "e.asp?e=出错，请不要输入&字符："&Request.Form(item) 
if CLen(Request.Form(item))>50 then response.Redirect "e.asp?e=出错，请不要输入超出50个字母或25个汉字："&Request.Form(item)&" 字数为："&CLen(Request.Form(item))
next

Function Chk_Num(number)
Chk_Num = True
ChkStr = "0123456789"
For cnt = 1 To Len(number)
Str1Chara = Mid(number, cnt, 1)
If InStr(ChkStr, Str1Chara) = 0 Then
Chk_Num = False
Exit For
End If
Next
End Function

	Function CheckStrinAsc(str)
		CheckStrinAsc = True
		If Len(str)=0 Or str = Null Then CheckStrinAsc = False:Exit Function
		For i = 1 To Len(str)
			If asc(mid(str,i,1)) < 0 Then	CheckStrinAsc = False:Exit Function
		Next
		If Len(str)<3 Then	CheckStrinAsc = False:Exit Function
		if CLen(str)>50 Then CheckStrinAsc = False:Exit Function
	End Function



If session("DNSAUID")="" then
	ef=True
	ec="授权非法，有可能是超时造成的。"
ElseIf not IsNumeric(session("DNSAUID"))  Then
	ef=True
	ec="ID应该是数字！"
'elseIf Enddomaintypeid=0 Then
'	ef=True
'	ec="无效的域名类型！"
'ElseIf Request.Form ("uname1")="" then
'	ef=True
'	ec="单位名称(中文)不能为空"
'ElseIf Enddomaintypeid=2 and CLen(Request.Form ("uname1"))<9 then
'	ef=True
'	ec="CN域名：单位名称必须是四个汉字以上才能注册(不能用个人姓名)"
'ElseIf Not CheckStrinAsc(Request.Form ("uname2")) then
'	ef=True
'	ec="单位名称(英文)不能为空，输入的内容必须是半角，长度在3-50个字符内。"
'ElseIf not Instr(Trim(Request.Form ("uname2")), " ")>1 then
'	ef=True
'	ec="单位名称(英文)，必须有空格！"
'ElseIf Instr(Trim(Request.Form ("uname2")), ".")>1 then
'	ef=True
'	ec="单位名称(英文)，不能有.号！"	
'ElseIf Not CheckStrinAsc(Request.Form ("uname3")) then
'	ef=True
'	ec="单位名称(拼音)不能为空，输入的内容必须是半角，长度在3-50个字符内。"
'ElseIf Request.Form ("uname4")="" and CLen(Request.Form ("uname4"))>10 and Not CheckStrinAsc(Request.Form ("uname4")) then
'	ef=True
'	ec="单位名称：(缩写)不能为空，输入的内容必须是半角，而且不能超过10个字符"
ElseIf Request.Form ("rname1")="" then
	ef=True
	ec="单位负责人：（中文）不能为空"
ElseIf Not CheckStrinAsc(Request.Form ("rname2")) then
	ef=True
	ec="单位负责人：（英文）不能为空，输入的内容必须是半角，长度在3-50个字符内。"
ElseIf not Instr(Trim(Request.Form ("rname2")), " ")>1 then
	ef=True
	ec="单位负责人(英文)，必须有空格！"
ElseIf Request.Form ("uprov")="" then
	ef=True
	ec="省份：不能为空"
ElseIf Request.Form ("ucity1")="" then
	ef=True
	ec="城市：（中文）不能为空"
ElseIf Not CheckStrinAsc(Request.Form ("ucity2")) then
	ef=True
	ec="城市：（英文）不能为空，输入的内容必须是半角，长度在3-50个字符内。"
ElseIf Request.Form ("uaddr1")="" then
	ef=True
	ec="街道地址：（中文）不能为空"
ElseIf Not CheckStrinAsc(Request.Form ("uaddr2")) then
	ef=True
	ec="街道地址：（英文）不能为空，输入的内容必须是半角，长度在3-50个字符内。"
'ElseIf Request.Form ("location")="" then
'	ef=True
'	ec="单位所在地点(中文)不能为空"
ElseIf Request.Form ("uzip")="" then
	ef=True
	ec="邮政编码：不能为空"
elseIf not Chk_Num(Request.Form ("uzip")) Then
	ef=True
	ec="邮政编码必须是半角数字！"
ElseIf Request.Form ("uemail")="" then
	ef=True
	ec="电子邮件：不能为空"
'ElseIf Request.Form ("aname1")="" then
'	ef=True
'	ec="姓名：（中文）不能为空"
'ElseIf Not CheckStrinAsc(Request.Form ("aname2")) then
'	ef=True
'	ec="姓名：（英文）不能为空，输入的内容必须是半角，长度在3-50个字符内。"
'ElseIf not Instr(Trim(Request.Form ("aname2")), " ")>1 then
'	ef=True
'	ec="姓名：（英文）中必须有空格！"
ElseIf Trim(Request.Form ("utela"))="" then
	ef=True
	ec="注册人电话区号不能为空"
elseIf not Chk_Num(Request.Form ("utela")) Then
	ef=True
	ec="注册人电话区号必须是半角数字！"
elseIf len(Request.Form ("utela"))>4 Then
	ef=True
	ec="注册人电话区号不能超过4位！"
elseIf len(Request.Form ("utela"))<2 Then
	ef=True
	ec="注册人电话区号不能小于2位！	"
ElseIf Trim(Request.Form ("ufaxa"))="" then
	ef=True
	ec="注册人传真区号不能为空"
elseIf not Chk_Num(Request.Form ("ufaxa")) Then
	ef=True
	ec="注册人传真区号必须是半角数字！"
elseIf len(Request.Form ("ufaxa"))>4 Then
	ef=True
	ec="注册人传真区号不能超过4位！"
elseIf len(Request.Form ("ufaxa"))<2 Then
	ef=True
	ec="注册人传真区号不能小于2位！"
'ElseIf Trim(Request.Form ("atela"))="" then
'	ef=True
'	ec="管理人电话区号不能为空"
'elseIf not Chk_Num(Request.Form ("atela")) Then
'	ef=True
'	ec="管理人电话区号必须是半角数字！"
'elseIf len(Request.Form ("atela"))>4 Then
'	ef=True
'	ec="管理人电话区号不能超过4位！"
'ElseIf Trim(Request.Form ("afaxa"))="" then
'	ef=True
'	ec="管理人传真区号不能为空"
'elseIf not Chk_Num(Request.Form ("afaxa")) Then
'	ef=True
'	ec="管理人传真区号必须是半角数字！"
'elseIf len(Request.Form ("afaxa"))>4 Then
'	ef=True
'	ec="管理人传真区号不能超过4位！"

ElseIf Trim(Request.Form ("uteln"))="" then
	ef=True
	ec="注册人电话号码不能为空"
elseIf not Chk_Num(Request.Form ("uteln")) Then
	ef=True
	ec="注册人电话号码必须是半角数字！"
elseIf len(Request.Form ("uteln"))>8 Then
	ef=True
	ec="注册人电话号码不能超过8位,请用固定号码！"
elseIf len(Request.Form ("uteln"))<7 Then
	ef=True
	ec="注册人电话号码不能小于7位,请用固定号码！"
elseIf clng(Request.Form ("uteln"))=88888888 Or clng(Request.Form ("uteln"))=8888888 Or clng(Request.Form ("uteln"))=0 Or clng(Request.Form ("uteln"))=12345678 Or clng(Request.Form ("uteln"))=1234567 Then
	ef=True
	ec="注册人电话号码不能超过为8888888/0000000/12345678/1234567/8888888/000000,请用固定号码！"
ElseIf Trim(Request.Form ("ufaxn"))="" then
	ef=True
	ec="注册人传真号码不能为空"
elseIf not Chk_Num(Request.Form ("ufaxn")) Then
	ef=True
	ec="注册人传真号码必须是半角数字！"
elseIf len(Request.Form ("ufaxn"))>8 Then
	ef=True
	ec="注册人传真号码不能超过8位,请用固定号码！"
elseIf len(Request.Form ("ufaxn"))<7 Then
	ef=True
	ec="注册人传真号码不能小于7位,请用固定号码！"
elseIf clng(Request.Form ("ufaxn"))=88888888 Or clng(Request.Form ("ufaxn"))=8888888 Or clng(Request.Form ("ufaxn"))=0 Or clng(Request.Form ("ufaxn"))=12345678 Or clng(Request.Form ("ufaxn"))=1234567 Then
	ef=True
	ec="注册人传真号码不能超过为8888888/0000000/12345678/1234567/8888888/000000,请用固定号码！"
'ElseIf Request.Form ("ateln")="" then
'	ef=True
'	ec="管理人电话号码不能为空"
'elseIf not Chk_Num(Request.Form ("ateln")) Then
'	ef=True
'	ec="管理人电话号码必须是半角数字！"
'elseIf len(Request.Form ("ateln"))>8 Then
'	ef=True
'	ec="管理人电话号码不能超过8位,请用固定号码！"
'elseIf len(Request.Form ("ateln"))<7 Then
'	ef=True
'	ec="管理人电话号码不能小于7位,请用固定号码！"
'ElseIf Request.Form ("afaxn")="" then
'	ef=True
'	ec="管理人传真号码不能为空"
'elseIf not Chk_Num(Request.Form ("afaxn")) Then
'	ef=True
'	ec="管理人传真号码必须是半角数字！"
'elseIf len(Request.Form ("afaxn"))>8 Then
'	ef=True
'	ec="管理人传真号码不能超过8位,请用固定号码！"
'elseIf len(Request.Form ("afaxn"))<7 Then
'	ef=True
'	ec="管理人传真号码不能小于7位,请用固定号码！"
ElseIf RegExpTest("^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$",Request("uemail"))=False then
	ef=True
	ec="注册人信息的内容：Email无效"
'ElseIf RegExpTest("^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$",Request("aemail"))=False then
'	ef=True
'	ec="管理人信息的内容：Email无效"
end if

if not ef then
Set conn=Server.CreateObject("ADODB.Connection")
	conn.Open Application("FreeHostDBlink")
Set dsdom = Server.CreateObject("ADODB.Recordset")
sql="Select * from FreeHost.FreeHost_Product_Domain where id='"&session("DNSAUID")&"'"
	dsdom.Open sql,conn,1,3
If Not dsdom.eof then
'dsdom("uname1")=request.form("uname1")
'dsdom("uname2")=Trim(request.form("uname2"))
dsdom("rname1")=request.form("rname1")
dsdom("rname2")=request.form("rname2")
dsdom("ust")=request.form("ust")
dsdom("uprov")=request.form("uprov")
dsdom("ucity1")=request.form("ucity1")
dsdom("ucity2")=request.form("ucity2")
dsdom("uaddr1")=request.form("uaddr1")
dsdom("uaddr2")=request.form("uaddr2")
dsdom("uzip")=request.form("uzip")
dsdom("utelc")=request.form("utelc")
dsdom("utela")=request.form("utela")
dsdom("uteln")=request.form("uteln")
dsdom("ufaxc")=request.form("ufaxc")
dsdom("ufaxa")=request.form("ufaxa")
dsdom("ufaxn")=request.form("ufaxn")
dsdom("uemail")=request.form("uemail")
End If
End if

if not ef then
Dim enc
Enddomaintypeid=GetDomaintype(dsdom("Domain"))


			'参数
			strdns1=dsdom("dns1")
			strdns2=dsdom("dns2")
			userid			=Application("Domain_Agent_username_5")			'万网数字ID
			password		=Application("Domain_Agent_password_5")		'万网数字ID密码
			email			=Application("Domain_Agent_username_5_emamil")	'万网注册email
			vtime			= FormatDate(now())
			userstr			=md5(userid&password&email&vtime)

			category		="domain"
			Select Case Enddomaintypeid
			Case 1 :tep_DomainTypes_net_cn="com"
			Case 30 :tep_DomainTypes_net_cn="com"
			Case 2 :tep_DomainTypes_net_cn="cn"
			Case 3 :tep_DomainTypes_net_cn="cnch"
			Case 4 :tep_DomainTypes_net_cn="biz"
			Case 5 :tep_DomainTypes_net_cn="info"
'			Case 6 :tep_DomainTypes_net_cn=""'----万网不支持通用网址
			Case 7 :tep_DomainTypes_net_cn="comch"
			Case 8 :tep_DomainTypes_net_cn="cc"
			Case 9 :tep_DomainTypes_net_cn="mobi"
			Case 10 :tep_DomainTypes_net_cn="tv"
'			Case 11 :tep_DomainTypes_net_cn="hk"
'			Case 12 :tep_DomainTypes_net_cn="tw"
			Case 13 :tep_DomainTypes_net_cn="bizch"
'			Case 14 :tep_DomainTypes_net_cn="infoch"----万网不支持
			Case 15 :tep_DomainTypes_net_cn="ccch"
'			Case 16 :tep_DomainTypes_net_cn="mobich"----万网不支持
			Case 17 :tep_DomainTypes_net_cn="tvch"
'			Case 18 :tep_DomainTypes_net_cn="hkch"----万网不支持
'			Case 19 :tep_DomainTypes_net_cn="twch"----万网不支持
			End Select

			productid		=tep_DomainTypes_net_cn	'万网域名类型临时变量
			action			="chgcontact"
			
			vsendStr		="userid="&userid&"&userstr="&userstr&"&vtime="&vtime
			
			vsendStr		=vsendStr&"&category="&category
			vsendStr		=vsendStr&"&productid="&productid
			vsendStr		=vsendStr&"&action="&action
			
			vsendStr		=vsendStr&"&domain="&server.URLEncode(dsdom("Domain"))
			vsendStr		=vsendStr&"&changetype=0"


			vsendStr		=vsendStr&"&organization="&server.URLEncode(dsdom("uname2"))
			vsendStr		=vsendStr&"&address="&server.URLEncode(dsdom("uaddr2"))
			vsendStr		=vsendStr&"&city="&server.URLEncode(dsdom("ucity2"))
			vsendStr		=vsendStr&"&state="&server.URLEncode(dsdom("uprov"))
			vsendStr		=vsendStr&"&postcode="&server.URLEncode(dsdom("uzip"))
			vsendStr		=vsendStr&"&country=CN"
			vsendStr		=vsendStr&"&phone=86-"&"0"&dsdom("uteln")
			vsendStr		=vsendStr&"&fax=86-"&"0"&dsdom("ufaxn")
			vsendStr		=vsendStr&"&email="&server.URLEncode(dsdom("uemail"))
			vsendStr		=vsendStr&"&lastname="&server.URLEncode(LCase(Split(dsdom("rname2")," ")(1)))
			vsendStr		=vsendStr&"&firstname="&server.URLEncode(LCase(Split(dsdom("rname2")," ")(0)))
			vsendStr		=vsendStr&"&name="&server.URLEncode(dsdom("rname1"))
			vsendStr		=vsendStr&"&manager="&server.URLEncode(dsdom("rname1"))
'			vsendStr		=vsendStr&"&organization_type="&server.URLEncode(dsdom("strTrade"))


'			vsendStr		=vsendStr&"&domain="&server.URLEncode(dsdom("Domain"))
			vsendStr		=vsendStr&"&address_zh="&server.URLEncode(dsdom("uaddr1"))
'			vsendStr		=vsendStr&"&name="&server.URLEncode(dsdom("rname1"))
'			vsendStr		=vsendStr&"&organization_zh="&server.URLEncode(dsdom("uname1"))
'			vsendStr		=vsendStr&"&manager="&server.URLEncode(dsdom("rname1"))
'			vsendStr		=vsendStr&"&organization_type=S8"
'			vsendStr		=vsendStr&"&ccity="&server.URLEncode(dsdom("ucity1"))
'			vsendStr		=vsendStr&"&cstate="&server.URLEncode(uprov)
'			vsendStr		=vsendStr&"&address_en="&server.URLEncode(dsdom("uaddr2"))
'			vsendStr		=vsendStr&"&lastname="&server.URLEncode(LCase(Split(dsdom("rname2")," ")(1)))
'			vsendStr		=vsendStr&"&firstname="&server.URLEncode(LCase(Split(dsdom("rname2")," ")(0)))
'			vsendStr		=vsendStr&"&organization_en="&server.URLEncode(LCase(dsdom("uname2")))
'			vsendStr		=vsendStr&"&city="&server.URLEncode(LCase(dsdom("ucity2")))
'			vsendStr		=vsendStr&"&state="&server.URLEncode(uprov)
'			vsendStr		=vsendStr&"&postcode="&server.URLEncode(dsdom("uzip"))
'			vsendStr		=vsendStr&"&country=CN"
'			vsendStr		=vsendStr&"&phone=86-0"&utela&dsdom("uteln")
'			vsendStr		=vsendStr&"&fax=86-"&"0"&ufaxa&dsdom("ufaxn")
'			vsendStr		=vsendStr&"&email="&server.URLEncode(dsdom("uemail"))
'			vsendStr		=vsendStr&"&admin_same_as=2"
'If Enddomaintypeid=21 Then
'			vsendStr		=vsendStr&"&tech_same_as=1"
'else
'			vsendStr		=vsendStr&"&tech_same_as=2"
'End if
'			vsendStr		=vsendStr&"&bill_same_as=2"

			'vsendStr=LIT_URLEncoding(vsendStr)

				'		Response.Write vsendStr
			'			Response.End

			retdns=LIT_RetrunStr("http://api.hichina.com/wwwnetcn.aspx",vsendStr)


'			Response.Write(retdns):Response.End()

dim returncodevalue,failreason
xmlvalue(retdns)
			If Instr(retdns,"200")<=0 Then
				retdns= "返回状态码:"&returncodevalue&" 原因:"&failreason
				response.write retdns
			End If		


	dsdom.update
	dsdom.close
	set dsdom=nothing
	conn.close
	set conn=nothing
%>
<HTML><HEAD><TITLE>保存</TITLE>
<META content="text/html; charset=gb2312" http-equiv=Content-Type>
<style type="text/css">
<!--
BODY {
	FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; FONT-SIZE: 12px
}
TABLE {
	FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; FONT-SIZE: 12px
}
TR {
	FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; FONT-SIZE: 12px
}
TD {
	FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; FONT-SIZE: 12px
}
P {
	FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; FONT-SIZE: 12px
}
INPUT {
	COLOR: #000000; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; FONT-SIZE: 12px
}
SELECT {
	COLOR: #000000; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; FONT-SIZE: 12px
}
TEXTAREA {
	COLOR: #000000; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif; FONT-SIZE: 12px
}
BODY {
	BACKGROUND: #ffffff; COLOR: #000000
}
.inputText {
	BACKGROUND: #ffffff; BORDER-BOTTOM: #c0c0c0 1px solid; BORDER-LEFT: #c0c0c0 1px solid; BORDER-RIGHT: #c0c0c0 1px solid; BORDER-TOP: #c0c0c0 1px solid
}
.inputRadio {
	BACKGROUND: #e8e8e8
}
.formHeader {
	BACKGROUND: #d0d0d0; COLOR: #000000; FONT-WEIGHT: bold
}
.formSubHeader {
	BACKGROUND: #e0e0e0; COLOR: #000000; FONT-WEIGHT: bold
}
.formItem {
	BACKGROUND: #e8e8e8; COLOR: #000000
}
.formText {
	BACKGROUND: #f0f0f0; COLOR: #000000
}
.formError {
	COLOR: #ff0000
}
.mainBorder {
	BACKGROUND: #666666
}
.mainHeader {
	BACKGROUND: #ffffff
}
.mainBody {
	BACKGROUND: #ffffff
}
.mainItem {
	BACKGROUND: #cccccc; FONT-WEIGHT: bold
}
.mainFooter {
	BACKGROUND: #ffffff
}
.mboxBorder {
	BORDER-BOTTOM: #d0d0d0 1px solid; BORDER-LEFT: #d0d0d0 1px solid; BORDER-RIGHT: #d0d0d0 1px solid; BORDER-TOP: #d0d0d0 1px solid
}
A {
	COLOR: #ff9900; TEXT-DECORATION: none
}
A:link {
	COLOR: #ff9900
}
A:visited {
	COLOR: #ff9900
}
A:active {
	COLOR: #ff9900; TEXT-DECORATION: underline
}
PRE {
	FONT-FAMILY: Lucida Console, Verdana, Arial, Helvetica, sans-serif; FONT-SIZE: 12px
}
-->
</style>
</head>
<BODY onload="" topmargin="0">
<TABLE border=0 align="center" cellPadding=0 cellSpacing=0 class=mainBorder>
  <TBODY>
  <TR>
     <TD>
        <table border="0" cellspacing="0" cellpadding="0" align="center" height="46">
                <tr>
                  <td height="46" width="84%" rowspan="2">&nbsp;</td>
                  <td height="30" width="16%">&nbsp;</td>
                </tr>
                <tr>
                  <td height="16" width="16%">&nbsp;</td>
                </tr>
       </table>
     </TD>
  </TR>
  <TR>
    <TD>
 <table align="center" bgcolor="#cccccc" border="0" cellpadding="3" cellspacing="1" class="content" width="700">
        <tbody> 
        <tr bgcolor="#e8e8e8"> 
          <td class="content" height="28"> 
            <div align="center"> <font color="#000000" size=12px><span style="letter-spacing: 2"><font size="2"><b> 
                  保存信息 </b></font></span></font></div>
          </td>
        </tr>
        <tr> 
              <td bgcolor="#ffffff" height="81" class="unnamed1"><font face="宋体" size="2"><span style="letter-spacing: 2">
              　　保存成功。<span class="unnamed1"><br>
              <br>　　
              <a href="/dns/logininfo.asp">[返回]</a></span></span></font></td>
        </tr>
        <tr> 
              <td bgcolor="#ffffff" class="unnamed1"><span style="letter-spacing: 2"></span></td>
        </tr>
        </tbody> 
      </table>
  
            </TD>
</TR></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
</BODY></HTML>

<%end if
if ef then
Response.Redirect "e.asp?e="&ec
end if%>