⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 admin_news_edit.asp

📁 发布整站源码 可以再开发~ 本人实用中 效果嗷嗷滴~
💻 ASP
字号:
<!--#include file="config.asp"-->
<!--#include file="conn.asp"-->
<!--#include file="code.asp"-->
<%
'检查管理员是否登录
AdminName = ReplaceBadChar(Trim(Request.Cookies(webkey)("AdminName")))
AdminPassword = ReplaceBadChar(Trim(Request.Cookies(webkey)("AdminPassword")))
RndPassword = ReplaceBadChar(Trim(Request.Cookies(webkey)("RndPassword")))
If AdminName = "" Or AdminPassword = "" Or RndPassword = "" Then
	Response.Redirect "Admin_login.asp"
End If
%>
<%
dim id
id=htmlencode(request("id"))
if id="" or (not isnumeric(id)) then
response.write "<script>alert('参数不正确!!!');window.close()</script>"
response.end
end if

set rs = server.createobject("adodb.recordset")
sql="SELECT * FROM News where id="&id
	rs.open sql,conn,1,1 
	if rs.bof and rs.eof then 
	rs.close
	response.write "<script>alert('无此数据!!!');window.close()</script>"
response.end
else
%>
<html>
<head>
<meta HTTP-EQUIV="Content-Type" content="text/html; charset=gb2312">
<LINK href="image/style.css" rel=stylesheet>
<title><%=webname%></title>
<SCRIPT language=JavaScript>
function check(){
if(document.form1.title.value=="")
{
alert("公告标题不能为空!");
document.form1.title.focus();
return false;
}
if(document.form1.Content.value=="")
{
alert("公告内容不能为空!");
document.form1.Content.focus();
return false;
}
if(document.form1.addtime.value=="")
{
alert("公告发布时间不能为空!");
document.form1.addtime.focus();
return false;
}
}
</SCRIPT>
</head>
<BODY text=#000000 link=#000000 leftMargin=0 bgcolor="#EFEFEF" topMargin=15>
<table width="90%"  border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#666666">
  <tr>
    <td bgcolor="#FFFFFF">&nbsp;&nbsp;&nbsp;<font color="#FF0000">编辑</font>公告“<font color="#FF0000"><b><%=rs("title")%></b></font>”的详细内容</td>
  </tr>
</table>
<br>
<TABLE cellSpacing=1 cellPadding=3 width=90% align=center bgColor=#000000 border=0>
  <FORM name=form1 onsubmit="return check()" action=admin_News_save.asp method=post language="javascript">
    <TBODY>
      <TR bgColor=#FFFFFF>
        <TD width="10%" bgcolor="#EFEFEF"><DIV align=center>公告标题:</DIV></TD>
        <TD width="75%"> 
            <INPUT name=title id="title" style="BORDER-RIGHT: 1px solid; BORDER-TOP: 1px solid; BORDER-LEFT: 1px solid; BORDER-BOTTOM: 1px solid" value="<%=rs("title")%>" size="50" maxLength=50></TD>
      </TR>
      <TR bgColor=#FFFFFF>
        <TD width="10%" valign="top" bgcolor="#EFEFEF"><DIV align=center>公告内容:</DIV></TD>
        <TD width="75%"> 
            <TEXTAREA id=Content name=Content rows=20 cols=70><%=rs("content")%></TEXTAREA>
        </TD>
      </TR>
      <TR bgColor=#FFFFFF>
        <TD width="10%" bgcolor="#EFEFEF"><DIV align=center>发布时间:</DIV></TD>
        <TD width="75%"> 
            <INPUT name=addtime id="addtime" 
style="BORDER-RIGHT: 1px solid; BORDER-TOP: 1px solid; BORDER-LEFT: 1px solid; BORDER-BOTTOM: 1px solid" value="<%=rs("addtime")%>" 
maxLength=20>
             时间格式为“年-月-日 时:分:秒”,如:<FONT color=#0000ff>2003-5-12 12:32:47</FONT> </TD>
      </TR>
      <TR bgColor=#FFFFFF>
        <TD width="10%" bgcolor="#EFEFEF"><div align="center">浏览次数:</div></TD>
        <TD> 
        <INPUT name=hits id="hits" 
style="BORDER-RIGHT: 1px solid; BORDER-TOP: 1px solid; BORDER-LEFT: 1px solid; BORDER-BOTTOM: 1px solid" value="<%=rs("hits")%>" size="10" 
maxLength=10></TD>
      </TR>
      <TR bgColor=#FFFFFF>
        <TD colSpan=2><DIV align=center>
            <span class="font2">
            <input name="id" type="hidden" id="id" value="<%=rs("id")%>">
            </span>
            <input name="options" type="hidden" id="options">
            <INPUT name=addnews type=submit id="addnews" onclick="form.options.value='edit'" value=" 确 定 ">
              
            <INPUT type=reset value=" 清 除 " name=cmdcancel>
            <span class="font2"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;[<a href="javascript:history.go(-1);">返回</a>]</span></DIV></TD>
      </TR>
    </TBODY>
  </FORM>
</TABLE>
</body>
</html>
<%
rs.close
end if
set rs=nothing
conn.close
set conn=nothing
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -