<!--#include file="inc/conn.asp"-->
<!--#include file="inc/safe.asp"-->
<!--#include file="inc/config.asp"-->
<!--#include file="inc/const.asp"-->
<%
if MemberName="" then
  response.Redirect("userlogin.asp")
  response.end
end if
%>
<%
dim errmsg
errmsg=""

dim title,content,smallid,bigid,addtime,author,authorid,theip

title=trim(ReplaceBadChar(request.Form("title")))
bigid=request.Form("bigid")
smallid=request.Form("smallid")
content=request.Form("content")
addtime=now()
author=MemberName
authorid=userid
theip=GetIp

'on error resume next
set rs=server.CreateObject("adodb.recordset")
sql="select * from jlbnews where title='"& title &"' and userid="& authorid &" and bigid="& bigid &""
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 title="" then errmsg=errmsg+"<br>"+"<li>文章的标题不能为空！"

if errmsg<>"" then 
 response.Write "<table width=400 align=center><tr><td height=25 style='font-size:12px'>错误信息：</td></tr>"
 response.write("<tr><td style='font-size:12px'>"+ errmsg +"<br></td></tr>")
 response.Write "<tr><td align='center'><input type='button' value='返回修改' onClick='javascript:window.history.back();'>"
 response.Write "<input type='button' value='关闭窗口' onClick='javascript:window.close();'></td></tr></table>"
 response.end
end if

set rst=server.CreateObject("adodb.recordset")   
sql1="select * from jlbnews where id is null"
rst.open sql1,conn,1,3
rst.addnew
rst("title")=title
rst("bigid")=bigid
rst("smallid")=smallid
rst("userid")=authorid
rst("content")=content
rst("username")=author
rst("dtime")=addtime
rst("ip")=theip
rst("click")=0
rst.update
rst.close
set rst=nothing

conn.close
set conn=nothing

BackInfo("club_increase.asp")
%>