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

📄 news_edit.asp

📁 使用Asp+Access+FSO+Jmail+Servu开发
💻 ASP
字号:
<!--#include file="admin.asp"-->

<%if Request.QueryString("action")="save" then
chk_admin_login(2)
id=request("id")
newstype=Trim(Request.Form("type"))
title=request("title")
content=server.htmlencode(Trim(Request("content")))


If title="" Then
response.write "SORRY <br>"
response.write "请输入更新内容的标题"
response.end
end if
If content="" Then
response.write "SORRY <br>"
response.write "内容不能为空"
response.end
end if


Set rs = Server.CreateObject("ADODB.Recordset")
sql="select * from news where id="&id
rs.open sql,conn,1,3

rs("type")=newstype
rs("title")=title
rs("content")=content
rs.update
rs.close
response.write"<script>alert('更新成功!');location.href='news_admin.asp'</script>"
end if
%>
<%
id=request.querystring("id")
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open "Select * From news where id="&id, conn,3,3
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../css/admin.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width="550" border="1" align="center" cellpadding="4" cellspacing="0" class="table-line">
  <form method="post" action="news_edit.asp?action=save">
    <input type=hidden name=id value=<%=id%>>
    <tr class="td-title-color">
      <td colspan="2" align="center"><table  border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td class="shadow">修改新闻</td>
        </tr>
      </table>      </td>
    </tr>
    <tr onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#BFDFFF'">
      <td align="center">新闻类型</td>
      <td>
        <select name="type" id="type">
          <option value="news" <%if rs("type")="news" then%>selected<%end if%>>最新公告</option>
          <option value="help" <%if rs("type")="help" then%>selected<%end if%>>帮助信息</option>
        </select>
      </td>
    </tr>
    <tr onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#BFDFFF'">
      <td align="center">标&nbsp;&nbsp;题</td>
      <td>
        <input type="text" name="title" maxlength="30" size="25" value="<%=rs("title")%>">
      </td>
    </tr>
    <tr onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#BFDFFF'">
      <td>
        <div align="center">UBB代码</div></td>
      <td>
        <script src=../Inc/ubbcode.js></script>
        <!--#include file="../inc/ubb.inc" -->
      </td>
    </tr>
    <tr onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#BFDFFF'">
      <td>
        <div align="center">内&nbsp;&nbsp;容</div></td>
      <td>
        <textarea name="content" cols="50" rows="6"><%=rs("content")%></textarea>
      </td>
    </tr>
    <tr onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#BFDFFF'">
      <td colspan="2">
        <div align="center">
          <input name="submit" type="submit" value="确定">
&nbsp;
          <input name="Submit" type="button" class="INPUT1" onClick="javascript:history.back()" value="返回">
      </div></td>
    </tr>
    <tr>
      <td colspan="2"></td>
    </tr>
  </form>
</table>
</body>
</html>

⌨️ 快捷键说明

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