<%dbs="../"%>
<!--#include file="../inc/config.asp"-->
<!--#include file="uccook.asp"-->
<!--#include file="uc.asp"-->

<%

if Uname="" or isnull(Uname)  then
response.Write "<script >alert('提示：\n\n对不起,资料还没有完善,请完善以后\n\n立即返回...');location.href='Profile_Edit.asp';</script>"
response.End()
end if

H_title=Replace(Replace(Left(request.Form("H_title"),50),"<","["),">","]")
H_sort=Replace(Replace(Left(request.Form("H_sort"),2),"<","["),">","]")
R_stop=Replace(Replace(Left(request.Form("R_stop"),3),"<","["),">","]")
H_Content=Left(request.Form("H_Content"),3000)
if H_sort="" then
response.Write "<script >alert('提示：\n\n对不起，请选择交友类型！...');history.back(-1);</script>"
response.End()
end if
if H_title="" then
response.Write "<script >alert('提示：\n\n对不起，请填写标题！...');history.back(-1);</script>"
response.End()
end if
if H_Content="" then
response.Write "<script >alert('提示：\n\n对不起，请填写交友内容！...');history.back(-1);</script>"
response.End()
end if
if R_stop="" then
response.Write "<script >alert('提示：\n\n对不起，请选择交友有效期时间！...');history.back(-1);</script>"
response.End()
end if
if R_stop=1 then
R_stop=date()+7
end if
if R_stop=2 then
R_stop=date()+14
end if
if R_stop=3 then
R_stop=date()+30
end if
if R_stop=4 then
R_stop=date()+90
end if
if R_stop=5 then
R_stop=date()+180
end if
H_Content=replace(H_Content,"table","表格")
H_Content=replace(H_Content,"TABLE","表格")
H_Content=replace(H_Content,"<tr","表格")
H_Content=replace(H_Content,"<td","表格")
H_Content=replace(H_Content,"</tr","表格")
H_Content=replace(H_Content,"</td","表格")

''开始写入数据
set rs=Server.CreateObject("Adodb.Recordset")
	sql="select * from H_pinke"
	rs.open sql,conn,1,3
	rs.addnew
	rs("UID")=UID
	rs("H_title")=H_title
	rs("H_Content")=H_Content
	rs("H_sort")=H_sort
	rs("R_date")=date()
	rs("R_stop")=R_stop
	rs.update
	rs.close
	set rs=nothing	
	response.Write "<script >alert('提示：\n\n添加成功,立即返回...');location.href='pinke_master.asp';</script>"
	response.End()
%>
