📄 addnew.asp
字号:
<% option explicit%>
<%'IF Session("AccountID")="" Then Response.Redirect %>
<!-- #include virtual="include/DataEnvi.asp" -->
<!-- #include virtual="include/Page.asp" -->
<%
Dim ObjDB,StrSQL
Dim C,ParentID
Dim ObjRS
Dim IntID
ParentID=Request.QueryString ("ParentID")
IntID=Request.QueryString ("ID")
If ParentID = "" Then
ParentID = 0
Else
ParentID = Cint(ParentID)
End If
If Request.Form.Count > 0 Then
Set ObjDB = Server.CreateObject("ADODB.Connection")
OpenDB ObjDB
Set C = Server.CreateObject("CMS2003.DBHandle")
C.Init(ObjDB)
ObjRS = C.AddNew("_","t_OA_Public_BBS")
If ParentID = 0 then
Response.Redirect "List.asp?BoardID=" & Request.form("_BoardID") & "&BoardName=" & Request.form("BoardName")
else
StrSQL = "Update t_OA_Public_BBS Set ReCount = ReCount + 1 Where ID ="&IntID
ObjDB.Execute StrSQL
Response.Redirect "View.asp?ID="&ParentID
end if
ObjDB.Close
Set ObjDB = Nothing
End If
Sub Main
%>
<% if ParentID=0 then%>
<form action="" method="post" onsubmit="return(CheckForm(this))" id=form1 name=form1>
<input type=hidden name=_BoardID value=<%=Request.QueryString("BoardID")%>>
<input type=hidden name=_AccountID value=<%=session("AccountID")%>>
<input type=hidden name=BoardName value="<%=Request.QueryString("BoardName")%>">
<table class=Ltable cellspacing=1 cellpadding=3 style="word-wrap;break-word;word-break;break-all">
<tr class=LHtr>
<td width="15%">新增文章</td>
<td width="85%"></td>
</tr>
<tr class=Ltr>
<td>文章标题</td>
<td><input type="text" size=40 class=Input Check=1 Show="文章标题" name="_Title" value=""></td>
</tr>
<tr class=Ltr>
<td>文章内容</td>
<td><textarea class=textarea cols=29 rows=15 name="_Body" value=""></textarea></td>
</tr>
</table>
<table cellspacing=1 cellpadding=3>
<tr>
<td>
<input type="submit" name="Submit" class=Button value="提 交">
<input type="button" class=Button value="取 消" onclick="doList()" id=button1 name=button1></td>
<td></td>
</tr>
</table>
</form>
<%end if%>
<%
End Sub
%>
<!-- #include file="Templet.asp" -->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -