<%dbs="../"%>
<!--#include file="../inc/config.asp"-->
<!--#include file="uccook.asp"-->
<!--#include file="uc.asp"-->
<%
'开始调用数据并开始上传
set rs=Server.CreateObject("Adodb.Recordset")
	sql="select * from H_Domain where H_UI=5 and  UID="&UID&""
	rs.open sql,conn,1,1
	if not rs.eof then
	response.Write "<script >alert('提示：\n\n 我们检测到您已经开通博客功能了\n\n我们将帮助您返回修改页...');location.href='shop_temp_Edit.asp';</script>"
	response.End()	
	end if
U_URL=Replace(Replace(Left(request.Form("U_URL"),30),"<","["),">","]")
U_TITLE=Replace(Replace(Left(request.Form("U_TITLE"),5),"<","["),">","]")
H_thread=Replace(Replace(Left(request.Form("H_thread"),200),"<","["),">","]")
'判断日期格式
if U_URL="" then
    response.write"<script >alert('提示：\n\n对不起，请填写二级域名！');history.back(-1);</script>"
response.end
end if
if U_TITLE="" then
    response.write"<script >alert('提示：\n\n对不起，请填写空间名称！');history.back(-1);</script>"
response.end
end if
if H_thread="" then
    response.write"<script >alert('提示：\n\n对不起，请选择空间样式！');history.back(-1);</script>"
response.end
end if
If Validate(U_URL,"^\w+$")<>True Then
    response.write"<script >alert('提示：\n\n对不起，您的二级域名不合法,由不可以含有符号！');history.back(-1);</script>"
response.end
End If
'检查该二级域名是否禁止让注册
set rs=Server.CreateObject("Adodb.Recordset")
	sql="select * from H_err where MyUrlerr='"&U_URL&"'"
	rs.open sql,conn,1,1
	if not rs.bof then
	response.Write "<script >alert('提示：\n\n对不起，该二级域名"&U_URL&"禁止注册,请更换...');history.back(-1);</script>"
	response.end 
	end if
rs.close
'开始检查二级域名是否重复
	set rs=Server.CreateObject("Adodb.Recordset")
		sql="select * from H_Domain where U_URL='"&U_URL&"'"
		rs.open sql,conn,1,1
		if not rs.bof then
		response.Write "<script >alert('提示：\n\n对不起，二级域名"&U_URL&"已让注册,请更换...');history.back(-1);</script>"
		response.end 
		end if
	rs.close

''开始写入数据
set rs=Server.CreateObject("Adodb.Recordset")
	sql="select * from H_Domain"
	rs.open sql,conn,1,3
	rs.addnew
	rs("UID")=UID
	rs("U_URL")=U_URL
	rs("U_TITLE")=U_TITLE
	rs("H_thread")=H_thread
	rs("H_UI")=5
	rs("Rdate")=now()
	rs.update
	rs.close
	set rs=nothing	
	response.Write "<script >alert('提示：\n\n开通成功,立即返回...');location.href='shop_temp_Edit.asp';</script>"
	response.End()	
%>

