news_list.asp

来自「一个较好的网上购物系统 是基于ASP的多用户网上商城」· ASP 代码 · 共 69 行

ASP
69
字号
<%
if session("admin")<>"smallstick" then
response.redirect "login.asp"
response.end
end if
%>
<!--#include file="conn.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>新闻管理</title>
<LINK href="../style.css" type=text/css rel=stylesheet>
</head>
<body>
<table width="100%" border="0">
  <tr> 
  
    <td align="center">
<%
set rs=server.createobject("adodb.recordset")
sql="select * from news"
rs.open sql,conn,1,3
if rs.eof or rs.bof then
%>
      <table width="98%" border="0">
        <tr> 
          <td >
			<p align="left">还没有任何新闻!<br>
            <a href="news_add.asp"><font color="#FF0000">添加新闻</font></a><font color="#FF0000">
			</font> </td>
        </tr>
      </table>
<p align="left"><font color="#FF0000">
<%else %>
      </font>
      <a href="news_add.asp"><font color="#FF0000">添加新闻</font></a><font color="#FF0000">
</font></p>
      <table width="98%" border="1" bordercolorlight="#FFFFFF" bordercolor="#59BE48">
        <tr align="center"> 
          <td><font color="#009933">ID</font></td>
          <td><font color="#009933">标题</font></td>
          <td><font color="#009933">日期</font></td>
          <td><font color="#009933">修改</font></td>
          <td><font color="#009933">删除</font></td>
        </tr>
<%do while not rs.eof %> 
        <tr align="center"> 
          <td><%=rs("news_id")%></td>
          <td><%=rs("news_title")%></td>
          <td><%=rs("news_date")%></td>
          <td><a href="news_edit.asp?news_id=<%=rs("news_id")%>">修改</a></td>
          <td><a href="news_del.asp?news_id=<%=rs("news_id")%>">删除</a></td>
        
<%
rs.movenext
loop
rs.close
set rs=nothing
conn.close
set conn=nothing
%> 
      </table>
    </td>
  </tr>
</table>
<%end if%>
</body>
</html>

⌨️ 快捷键说明

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