📄 admin_add.asp
字号:
<!--#INCLUDE FILE="../HXINCLUDE/HXINCLUDEHEAD.ASP"-->
<%
if WS_S.MemberPriv("WS_FrontSetActicle")<>1 then HX_GoBack "对不起,您的权限不够!",""
dim SortID,Sort1,Sort2,sContent
'信息的添加----------------
If Request("action")="add" Then
SortID=trim(Request.Form("SortId"))
If SortID="isnull" Then
Response.Write "<script>alert(""请选择信息类型!"");location.href=""javascript:history.back()"";</script>"
Response.end()
end if
if SortID="null" Then
Response.Write "<script>alert(""你选的类别有二级分类,请选一个二级分类!"");location.href=""javascript:history.back()"";</script>"
Response.end()
end if
if Request.form("title")="" Then
Response.Write "<script>alert(""请输入信息标题!"");location.href=""javascript:history.back()"";</script>"
Response.end()
end if
if Request.form("Content")="" Then
Response.Write "<script>alert(""请输入信息内容!"");location.href=""javascript:history.back()"";</script>"
Response.end()
end if
if Request.form("Key")="" Then
Response.Write "<script>alert(""请输入关键字!"");location.href=""javascript:history.back()"";</script>"
Response.end()
end if
Set rs = Server.CreateObject("ADODB.Recordset")
sql="select * from Info"
rs.open sql,conn,1,3
rs.addnew
SortID=Request.Form("SortId")
Sort1=left(SortID,Instr(SortID,"|")-1) '到字符“|”的长度减去1取得ID长度
Sort2=right(SortID,len(SortID)-Instr(SortID,"|")) '总长减去到字符“|”的长度
rs("Sort1")=Sort1
rs("Sort2")=Sort2
rs("Title")=Server.HTMLEncode(Trim(Request("Title")))
rs("Content")= request("content")
rs("Key")=server.HTMLEncode(Trim(Request("Key")))
rs("Date")=server.HTMLEncode(Trim(Request("Date")))
rs("ReadGrade")=0
if Request("Pw_Good")<>"" then
rs("Pw_Good")=Request("Pw_Good")
else
rs("Pw_Good")=False
end if
rs("author")=LOGINUSERNAME
rs("department")=LOGdepartment
rs("writerid")=LOGINUid
rs("AddDate")=DATE()
if Request("Pic")<>""then
rs("Pic")=Request("Pic")
rs("Ispic")=1
else
rs("Ispic")=0
end if
rs("Pass")=0
rs("Special")=0
rs.update
rs.close
conn.Close
Set conn=nothing
Response.Write "<script>alert(""发布成功"");location.href=""Admin_Add.asp"";</script>"
Response.End
end if
%>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../HXinclude/HX_Style.css" rel="stylesheet" type="text/css">
<script language="JavaScript" type="text/JavaScript">
// 信息表单提交客户端检测
function doSubmit(){
if (document.form.SortID.value=="Add"){
alert("请先添加信息类型!");
return false;
}
if (document.form.SortID.value=="isnull"){
alert("请选择信息类型!");
return false;
}
if (document.form.SortID.value=="null"){
alert("你选的类别有二级分类,请选一个二级分类!!");
return false;
}
if (document.form.title.value==""){
alert("信息标题不能为空!");
return false;
}
if (document.form.key.value==""){
alert("关键字不能为空!");
return false;
}
if (Content.getHTML()==""){
alert("信息内容不能为空!");
return false;
}
return true;
}
</script>
</head>
<body topmargin='20' leftmargin='0' bottommargin='0'>
<table width='596' border='0' cellspacing='1' cellpadding='0' align=center bgcolor='#115F8F'><tr><td colspan='2' bgcolor=ffffff>
<table width='100%' border='0' cellspacing='0' cellpadding='0'><tr><td height='25' background='../hximages/titleline.gif'><font class='fontmenu'>添加信息</font></td></tr></table>
<table width='100%' border='0' cellspacing='1' cellpadding='3' bgcolor='#A1BBE0'>
<form action="?action=add" method="POST" name="form" id="form" onSubmit="return doSubmit()">
<tr bgcolor='#FFFFFF' onmouseover=javascript:this.bgColor='#F9F8F2' onmouseout=javascript:this.bgColor='#ffffff'>
<td height="23" align="left" valign="middle"> 信息类型:
<select name="SortID" id="SortID"><option selected value="isnull">===请选择栏目===</option>
<%
Set rs = Server.CreateObject("ADODB.Recordset")
sql="select * from a125_type where a125_big_id=0 and a125_setting<>4 and a125_setting<>5 order by a125_order"
rs.OPEN sql,Conn,1,1
if not (rs.eof and rs.bof) then
rs.movefirst
do while not rs.eof
sql="Select * from a125_type where a125_big_id= "& Rs("ID") &" and a125_setting<>3 order by a125_order"
Set rs2 = Server.CreateObject("ADODB.Recordset")
rs2.OPEN sql,Conn,1,1
if not (rs2.eof and rs2.bof) then
do while not rs2.eof
%>
<option value='<%=trim(rs("Id"))%>|<%=trim(rs2("Id"))%>'>『<%=rs("a125_names")%>』<%=rs2("a125_names")%></option>
<%
rs2.movenext
loop
end if
rs.movenext
rs2.close
set rs2=nothing
loop
end if
rs.close
set rs=nothing
conn.Close
Set conn=nothing
%>
</select>
</td>
</tr>
<tr bgcolor='#FFFFFF' onmouseover=javascript:this.bgColor='#F9F8F2' onmouseout=javascript:this.bgColor='#ffffff'>
<td height="23" align="left" valign="middle"> 信息标题:
<input type="text" name="title" size="40" id="信息标题" maxlength="100">
<input name="Pw_Good" type="checkbox" id="Pw_Good" style="border:0px" value="True"> 推荐(首页显示)</td>
</tr>
<tr bgcolor='#FFFFFF' onmouseover=javascript:this.bgColor='#F9F8F2' onmouseout=javascript:this.bgColor='#ffffff'>
<td align="left" valign="middle">
<textarea name="Content" id="Content" style="display:none"></textarea>
<IFRAME ID="Content1" SRC="../editor.asp?id=Content" FRAMEBORDER="0" SCROLLING="no" WIDTH="590" HEIGHT="425"></IFRAME>
</td>
</tr>
<tr bgcolor='#FFFFFF' onmouseover=javascript:this.bgColor='#F9F8F2' onmouseout=javascript:this.bgColor='#ffffff'>
<td height="23" valign="middle">相关信息:<input name=Key type="text"class="smallinput" ID=Key value="关键字" size="10" maxlength="50">
发布日期: <input name="Date" type="text" id="时间" value="<%=Date()%>" size="10" readonly>
<%
' 保存远程图片:<input name="SavePic" type="checkbox" style="border:0px" value="1" readonly>是
%><font color="red">*</font>注:图片上传请点图标<img src="../images/edit/Img.gif" width="22" height="22">
</td>
</tr>
<tr bgcolor="#EAEAEA">
<td height="23" align="center"> <input name="cmdok" type="submit" class="buttonface" value=" 添 加 " onClick="return doSubmit()">
<input type="reset" value=" 清 除 "
name="cmdcancel" class="buttonface"> </td>
</tr></form>
</table>
</td></tr></table><br>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -