<!-- #include file="../Inc.asp" -->
<!-- #include file="../ydzq.asp"-->

<%

Call Head()


set rs=Server.CreateObject("ADODB.Recordset")
  rs.open"select zoneidcd from Users where id="&myid,conn,1,2
if rs("zoneidcd")=1 Then



call saycarda(""&zonenamee&"")
response.write "您已开通空间了,如须修改请进入个人档!<br/><a href=""index.asp?sid="&sid&"&amp;saytk="&saytk&""">正在转往我的空间…</a>"

Call head1()
response.end
end if
rs.close
set rs=Nothing



call saycarda("申请空间")



dim action,name,txt
name=trim(request.form("name"))
txt=trim(request.form("txt"))
action=trim(request.querystring("action"))
if action="ok" then
if name="" then
  Call Errorh("空间名称不能为空！")
end if
if txt="" then
  Call Errorh("个性签名不能为空！")
end if
if len(name)>6 then
  Call Errorh("空间名称最多十字！")
end if
if len(txt)>50 then
  Call Errorh("个性签名最多50字！")
end if
set rs=Server.CreateObject("ADODB.Recordset")
rs.open"select * from zone where zoneid="&myid,conn,1,1
if not rs.eof then
  Call Errorh("你已经申请了一个空间了,请不要重复申请！")
  end if
  rs.close
set rs=nothing
set rs=Server.CreateObject("ADODB.Recordset")
rs.open"select * from zone",conn,1,2
rs.addnew
rs("zonename")=name
rs("zonecf")=txt
rs("zoneid")=myid
rs("tm")=now()
rs("zoneyulou_tm")=date()
rs("zonefktm")=date()
rs.update
rs.close
set rs=nothing
conn.Execute("update Users set zoneidcd=1 Where id="&myid)
'取ID
dim tid
set rs=Server.CreateObject("ADODB.Recordset")
rs.open"select top 1 ID from [zone] order by id desc",conn,1,1
tid=rs("ID")
rs.close
set rs=nothing
'减币,设置

response.write"恭喜,您的空间申请成功!<br/><a href=""/bbs/blog/index.asp?sid="&sid&"&amp;saytk="&saytk&""">点击进入我的空间…</a><br/>"

Else

response.write"<br/>空间名称，不能为空<br/>"
if saytk=2 Or saytk=3 then
 Response.Write "<form name=""zslim"" action=""zone_add.asp?action=ok&amp;sid="&sid&"&amp;saytk="&saytk&""" method=""post"">"
end if
response.write"<input name='name' title='名称'/><br/>"
response.write"签名<br/>"
response.write"<input name='txt' title='签名'/><br/>"
if saytk=2 Or saytk=3 then
Response.Write "<input type=""submit"" value=""确定申请""/></form><br/>"
else
response.write"<anchor>[确定申请]<go href='zone_add.asp?action=ok&amp;sid="&sid&"&amp;saytk="&saytk&"' method='post' accept-charset='utf-8'>"
response.write"<postfield name='name' value='$(name)'/>"
response.write"<postfield name='txt' value='$(txt)'/>"
response.write"</go></anchor>"
end if
end if
conn.close
set conn=nothing

call headsay()
%>  
