📄 newadd.asp
字号:
<!--#include file="head.asp"-->
<script src="ubbcode.js"></script>
<%
If Request("action") = "add" Then
txttitle = Strcheck(Request.Form("txttitle"))
Intime = Request.Form("year1")&"-"&Request.Form("month1")&"-"&Request.Form("day1")
txtcontent = Strcheck(Request.Form("txtcontent"))
key = Strcheck(Request.Form("key"))
writer = Strcheck(Request.Form("writer"))
writefrom = Strcheck(Request.Form("writefrom"))
classid = Request.Form("classid")
Nclassid = Request.Form("Nclassid")
Sql = "Insert into article(content,title,Nclassid,classid,Nkey,dateandtime,writer,writefrom,author)values("
Sql = Sql & txtcontent &","& txttitle &","& Nclassid &","& classid &","& key &",'"& Intime &"',"
Sql = Sql & writer &","& writefrom &",'"& Session("admin") &"')"
conn.execute(Sql)
Response.Write "<script>alert(""发布成功!请更新首页公告静态页面"");location.href=""NewAdd.asp"";</script>"
Response.End
End IF
dim rs
dim sql
dim count
set rs = conn.execute("select * from ANclass order by Nclassid asc")
%>
<script language = "JavaScript">
var onecount;
onecount=0;
subcat = new Array();
<%
count = 0
do while not rs.eof
%>
subcat[<%=count%>] = new Array("<%= trim(rs("Nclass"))%>","<%= trim(rs("classid"))%>","<%= trim(rs("Nclassid"))%>");
<%
count = count + 1
rs.movenext
loop
rs.close
%>
onecount=<%=count%>;
function changelocation(locationid)
{
document.myform.Nclassid.length = 0;
var locationid=locationid;
var i;
for (i=0;i < onecount; i++)
{
if (subcat[i][1] == locationid)
{
document.myform.Nclassid.options[document.myform.Nclassid.length] = new Option(subcat[i][0], subcat[i][2]);
}
}
}
</script>
<form method="POST" name="myform" action="?action=add" onSubmit = "return check();">
<table width="96%" border="1" cellspacing="0" cellpadding="3" align="center" bordercolorlight="#cccccc" bordercolordark="#FFFFFF">
<tr valign="middle" bgcolor="#FF3366">
<td colspan="2" align="center">添 加 文 章</td>
</tr>
<tr>
<td width="15%" align="left" valign="middle">文章类型:</td>
<td width="85%">
<%
set rs = conn.execute("select * from Aclass")
if rs.eof and rs.bof then
response.write "请先添加栏目。"
response.end
else
%>
<select name="classid" onChange="changelocation(document.myform.classid.options[document.myform.classid.selectedIndex].value)" size="1">
<%do while not rs.eof%>
<option selected value="<%=trim(rs("classid"))%>"><%=trim(rs("class"))%></option>
<%
rs.movenext
loop
end if
rs.close
set rs = nothing
conn.Close
set conn = nothing
%>
</select>
<select name="Nclassid">
<option selected value="">公告类型选择</option>
</select>
** </td>
</tr>
<tr>
<td width="15%" align="left" valign="middle">文章标题:</td>
<td width="85%">
<input type="text" name="txttitle" size="60"
class="smallinput" maxlength="30">
</td>
</tr>
<tr>
<td width="15%" align="left" valign="middle">UBB 标签:</td>
<td width="85%">
<!--#include file="getUbb.asp" -->
</td>
</tr>
<tr>
<td width="15%" align="left" valign="middle">发布日期:</td>
<td width="85%">
<select name="year1">
<option value="<%=year(Now())%>" selected><%=year(Now())%></option>
<%
for i=2001 to 2005
response.write "<option value='"&i&"'>"&i&"</option>"
next
%>
</select>
年
<select name="month1">
<option value="<%=month(Now())%>" selected><%=month(Now())%></option>
<%
for i=1 to 12
response.write "<option value='"&i&"'>"&i&"</option>"
next
%>
</select>
月
<select name="day1">
<option value="<%=day(Now())%>" selected><%=day(Now())%></option>
<%
for i=1 to 31
response.write "<option value='"&i&"'>"&i&"</option>"
next
%>
</select>
日 </td>
</tr>
<tr>
<td width="15%" align="left" valign="middle" rowspan="4">文章内容:</td>
<td width="85%">
<textarea rows="5" name="txtcontent" cols="70" class="smallarea"></textarea>
</td>
</tr>
<tr>
<td width="85%"><img src="../face/a1.gif"> <img src="../face/a2.gif">
<img src="../face/a3.gif"> <img src="../face/p1.gif"> <img src="../face/p2.gif">
<img src="../face/p3.gif"> <img src="../face/p4.gif"> <img src="../face/p5.gif">
<img src="../face/p6.gif"> <img src="../face/p7.gif"> <img src="../face/p8.gif">
<img src="../face/p9.gif"> <img src="../face/p10.gif"> <img src="../face/p11.gif">
<img src="../face/p12.gif"> <img src="../face/p13.gif"> <img src="../face/p14.gif">
<img src="../face/p15.gif"> <img src="../face/p16.gif"> <img src="../face/p17.gif">
<img src="../face/p18.gif"> <img src="../face/p19.gif"> <img src="../face/p20.gif">
<img src="../face/p21.gif"> <img src="../face/p22.gif"> <img src="../face/p23.gif">
</td>
</tr>
<tr>
<td width="85%"><img src="../face/p24.gif"> <img src="../face/p25.gif">
<img src="../face/p26.gif"> <img src="../face/p27.gif"> <img src="../face/p28.gif">
<img src="../face/p29.gif"> <img src="../face/p30.gif"> <img src="../face/p31.gif">
<img src="../face/p32.gif"> <img src="../face/p33.gif"></td>
</tr>
<tr>
<td width="85%"><img src="../face/p34.gif"> <img src="../face/p35.gif">
<img src="../face/p36.gif"> <img src="../face/p37.gif"> <img src="../face/p38.gif">
<img src="../face/p39.gif"> <img src="../face/p40.gif"> <img src="../face/p41.gif">
<img src="../face/p42.gif"> <img src="../face/p43.gif"> <img src="../face/p44.gif">
<img src="../face/p45.gif"> <img src="../face/p46.gif"> <img src="../face/p47.gif">
<img src="../face/p48.gif"> <img src="../face/p49.gif"> <img src="../face/p50.gif">
<img src="../face/p51.gif"> </td>
</tr>
<tr>
<td width="15%" align="left" valign="middle">表情符号:</td>
<td width="85%">
<input type="text" name="writer" size="20"
class="smallinput" maxlength="100" value="face/p19.gif">
face/p1.gif ~~ face/p33.gif</td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="submit" value=" 添 加 "
name="cmdok" class="buttonface">
<input type="reset" value=" 清 除 "
name="cmdcancel" class="buttonface">
</td>
</tr>
</table>
</form>
<script language="JavaScript">
function check(){
if (myform.Nclassid.value ==""){
alert("请选择小栏目");
myform.Nclassid.focus();
return false;
}
if (myform.txttitle.value ==""){
alert("请输入文章标题");
myform.txttitle.focus();
return false;
}
if (myform.txtcontent.value ==""){
alert("请输入文章内容");
myform.txtcontent.focus();
return false;
}
return true;
}
</script>
<!--#include file="copy.asp"-->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -