<!--#include file="inc/conn.asp"-->
<!--#include file="inc/config.asp"-->
<!--#include file="inc/safe.asp"-->
<%
dim errmsg
errmsg=""

dim uname,title,email,msn,sheng,shi
dim tel,xiangmu,qq,content
uname=trim(ReplaceBadChar(request.Form("uname")))
title=trim(ReplaceBadChar(request.Form("title")))
msn=request.Form("msn")
email=trim(ReplaceBadChar(request.Form("email")))
sheng=request.Form("sheng")
shi=request.Form("shi")
tel=trim(ReplaceBadChar(request.Form("tel")))
qq=trim(ReplaceBadChar(request.Form("qq")))
xiangmu=request.Form("xiangmu")
content=iHTMLEncode(request.Form("content"))

'on error resume next
set rs=server.CreateObject("adodb.recordset")
sql="select * from hezuo where uname='"& uname &"' and title='"& title &"'"
rs.open sql,conn,1
if not(rs.eof or rs.bof) then
  errmsg=errmsg+"<li><strong><font size=4>您已经提交过此信息，请不要重复提交！</font></strong>"
end if 
rs.close
set rs=nothing

if uname="" then errmsg=errmsg+"<br>"+"<li>您的帐号不能为空！"
if checkshit(uname) then  errmsg=errmsg+"<br>"+"<li>帐号可能含不文明词语，请检查！"
if sheng="" or shi="" then errmsg=errmsg+"<br>"+"<li>请选择您的籍贯和所在城市！"

if errmsg<>"" then 
response.Write "错误信息：<br>"
response.write("　　　"+ errmsg)
response.Write "<input type='button' value='返回修改' onClick='javascript:window.history.back(-1);'>"
response.Write "<input type='button' value='关闭窗口' onClick='javascript:window.close();'>"
response.end
end if

set rst=server.CreateObject("adodb.recordset")  
sql1="select * from hezuo where id is null"
rst.open sql1,conn,1,3
rst.addnew
rst("uname")=uname
rst("title")=title
rst("sheng")=sheng
rst("shi")=shi
rst("email")=email
rst("tel")=tel
rst("msn")=msn
rst("xiangmu")=xiangmu
rst("qq")=qq
rst("content")=content
rst("dtime")=now()
rst.update
rst.close
set rst=nothing

conn.close
set conn=nothing
response.Write "<script language='javascript'>alert('您的合作信息已经成功提交！');window.location='application.asp'</script>"
response.end
%>