addnews.asp
来自「网站的后台管理代码......内容比较全面....新手比较适合」· ASP 代码 · 共 110 行
ASP
110 行
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="../inc/adconn.asp"-->
<!--#include file="../css.asp"-->
<% set rs=server.CreateObject("adodb.recordset") %>
<%
if session("admin_name")="" then
response.end
end if%>
<% dim title,pic,content,sclass
if request("action")="save" then
title=trim(request.Form("title"))
content=trim(request.Form("hw_content"))
sclass=request.Form("sclass")
fabu=request.Form("fabu")
sql="select * from news order by id desc"
rs.open sql,conn,1,3
rs.addnew
rs("title")=title
rs("content")=content
rs("sclass")=sclass
rs("hit")=0
rs("fabu")=fabu
rs.update
response.Write "添加新闻成功!!"
response.Write "<a href='dealnews.asp'>"
Response.Write "返回"
Response.Write("</a>")
%>
<%end if%>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<title>添加新闻</title>
<link rel="stylesheet" type="text/css" href="style.css">
<form method="POST" name="form2" action="addnews.asp?action=save">
<INPUT name=upfile onchange=return(OnUpFile()) type=hidden>
<INPUT name=upfile2 onchange=return(OnUpFile2()) type=hidden>
<TABLE cellSpacing=1 cellPadding=0 width="550" align=center bgColor=#999999
border=0>
<TBODY>
<TR>
<TD width="735" bgcolor="f0f0f0" id=maintitleback>
<TABLE cellSpacing=0 cellPadding=3 width="100%" border=0>
<TBODY>
<TR>
<TD width="100%" height="30" valign="bottom" bgcolor="#FFCC00" id=maintitle>新闻添加 -><b>所有选项都必须填写</b></TD>
</TR>
</TBODY>
</TABLE>
</TD>
</TR>
<TR>
<TD id=mainbg>
<TABLE cellSpacing=1 cellPadding=4 width="100%" border=0 height="156">
<TBODY>
<TR>
<TD height="30" noWrap
background=../images/pics/tile_sub.gif id=titlemedium> <div align="center"><font color="#FFFFFF">新闻名称</font></div></TD>
<TD height="30" noWrap
background=../images/pics/tile_sub.gif id=titlemedium></label>
<font color=#333333>
<input type="text" name="title">
</font>
<div align="center"></div> </TD>
</TR>
<TR>
<TD bgColor=#ffffff height="30"> <div align="center" style="color: #000000">新闻类型</div></TD>
<TD height="30" align=left bgColor=#ffffff><label>
<select name="sclass">
<option value="1">公司新闻</option>
<option value="2">行业新闻</option>
</select>
</label></TD>
<TR>
<TD bgColor=#ffffff height="30">
<div align="center" style="color: #000000">新闻简介</div></TD>
<TD height="30" align=center bgColor=#ffffff><input type="hidden" name="hw_content">
<iframe id="eWebEditor1" src="../eWebEditor/ewebeditor.asp?id=hw_content&style=s_blue" frameborder="0" scrolling="no" width="550" height="350"></iframe>
<font color=#ff6600> *</font></TD>
</TR>
<TR>
<TD height="30" colspan="2" bgColor=#ffffff> <div align="center">发布人
<input type="text" name="fabu" value="<%=session("admin_name")%>">
</div></TD>
</TR>
<TR>
<TD id=mainfoot colSpan=2 height="30"> <div align="center">
<table width="30%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="25"> <div align="center">
<input name=submit2 type=image src="../IMAGES/pics/s_button000.gif" alt=进入 align=absMiddle width="45" height="20" cache tppabs="" >
</div></td>
<td> <div align="center">
<input type="reset" value="全部重写" name="B22" class=input>
</div></td>
</tr>
</table>
</div></TD>
</TR>
</TBODY>
</TABLE>
</TD>
</TR>
</TBODY>
</TABLE></form>
</body>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?