<!--#include file="conn.asp"-->
<!--#include file="../inc/function.asp"-->
<!--#include file=cookies.asp-->
<%

Call Chk_Post()

Select Case request("cmd")
	Case "add"
		Call Chk_Time(KEEP_TIME)
		Call AddLove()
	Case "del"
		Call DelLove()

	Case Else
		conn.close		
		Set conn=Nothing
		response.redirect "etietie.asp"
End Select 

Sub AddLove() 
	Dim kqiqi_checkcode,GetCode	
kqiqi_checkcode=CStr(session("GetCode"))
session("GetCode")=""
if kqiqi_checkcode<>CStr(request("kqiqi_checkcode"))  then
Response.write"<script>alert(""验证码不正确，请刷新后重写！  "");history.back();</script>"
Response.end
end if 
	Dim send,pick,info
		send=Trim(request("send"))
		pick=Trim(request("pick"))
		info=Trim(request("info"))
	If BadWord(send,BAN_LIST) Or BadWord(pick,BAN_LIST) Or BadWord(info,BAN_LIST) Then
		response.write "<script type='text/javascript'>alert('您用词不当');history.go(-1);</script>"
		response.End 
	End If
	Dim sql,rs,ip,face,icon,id
	send=ReplaceBadChar(send)
	If send="" Then send="匿名"
	pick=ReplaceBadChar(pick)
	info=server.htmlencode(info)
	ip=GetIP()	
	face=request("face")
	icon=request("icon")	
	sql="Select * From  tietie"
	Set rs=server.CreateObject("adodb.recordset")
	rs.open sql,conn,1,3	
	rs.addnew
	rs("Info")=info
	rs("Send")=send
	rs("Pick")=pick
	rs("IP")=ip
	rs("PostDate")=Now()
	rs("Face")=face
	rs("Icon")=icon
	rs.update
	id=rs("ID")
	rs.close
	Set rs=Nothing
	conn.close		
	Set conn=Nothing
	response.write "<script type='text/javascript'>alert('成功添加\n你的字条编号是["&id&"]  ');location.href='etietie.asp?id="&id&"';</script>"
End Sub  


Sub DelLove()
	Dim id
		id=CLng(request("id"))
	conn.execute "Delete From tietie Where ID ="&id
	conn.close		
	Set conn=Nothing
	response.write "<script type='text/javascript'>alert('成功删除');location.href='tqlist.asp';</script>"
End Sub



%>