📄 news.asp
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file=../../conn/adminconn.asp-->
<!--#include file="login.asp"-->
<%
'新闻删除
if request("del")<>"" then
sql1="delete from new where id="&request("del")
conn.execute(sql1)
end if
'新闻模糊查询
if request("pp")<>"" then
set rs=server.CreateObject("adodb.recordset")
sql="select * from new where title like '%"&request("bianhao")&"%'"
rs.open sql,conn,1,1
else
set rs=server.CreateObject("adodb.recordset")
sql="select * from new"
rs.open sql,conn,1,1
End If
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<style type="text/css">
<!--
body,td,th {
font-size: 12px;
}
a:link {
color: #000000;
text-decoration: none;
}
a:visited {
color: #000000;
text-decoration: none;
}
a:hover {
color: #000000;
text-decoration: none;
}
a:active {
text-decoration: none;
}
.style4 {color: #000000}
-->
</style>
</head>
<body>
<form name="form1" method="post" action="">
<table width="95%" border="0" align="center">
<tr>
<td height="30" valign="middle" bgcolor="#FF9900"> 请输入您要查找的关键字:
<input name="bianhao" type="text" id="bianhao">
<input type="submit" name="Submit" value="查找">
<input name="pp" type="hidden" id="pp" value="tt"></td>
</tr>
</table>
</form>
<br>
<table width="95%" border="0" align="center">
<tr>
<td height="30" valign="middle" bgcolor="#FF9900"> <a href="newadd.asp">添加</a><a href="newadd.asp"><img src="../images/profile.gif" width="45" height="18" border="0" align="absbottom"></a></td>
</tr>
</table>
<br>
<table width="95%" border="0" align="center" cellspacing="1" bgcolor="#CCCCCC">
<tr >
<td width="12%" height="35" background="../images/tiao.gif"><div align="center"><span class="style4">编号</span></div></td>
<td width="36%" background="../images/tiao.gif"><div align="center" class="style4">新闻标题</div> </td>
<td width="19%" background="../images/tiao.gif"><div align="center" class="style4">新闻类型</div></td>
<td width="14%" background="../images/tiao.gif"><div align="center"><span class="style4">发布时间</span></div></td>
<td colspan="2" background="../images/tiao.gif"><div align="center"><span class="style4">管理</span></div></td>
</tr>
<%
if not rs.eof then
tol=rs.recordcount
show=15
rs.pagesize=show
maxpage=rs.pagecount
requestpage=clng(request("p"))
if requestpage="" or requestpage=0 then
requestpage=1
end if
if requestpage>maxpage then
requestpage=maxpage
end if
if requestpage<>1 then
rs.move (requestpage-1)*rs.pagesize
end if
for i=1 to rs.pagesize and not rs.eof
%>
<tr>
<td height="37" bgcolor="#FFFFFF"><div align="center"><%= rs("id") %></div></td>
<td bgcolor="#FFFFFF"><div align="center"><%= rs("title") %></div> </td>
<td bgcolor="#FFFFFF"><div align="center"><%=rs("lei")%></div></td>
<td bgcolor="#FFFFFF"><div align="center"><%= rs("time") %></div></td>
<td width="10%" bgcolor="#FFFFFF"><div align="center"><a href="newed.asp?id=<%=rs("id")%>">修改</a></div></td>
<td width="9%" bgcolor="#FFFFFF"><div align="center"><a href="news.asp?del=<%=rs("id")%>&p=<%=requestpage%>" onClick="return confirm('你确定删除吗?')">删除</a></div></td>
</tr>
<%
rs.movenext
if rs.eof then exit for
next
else
response.Write("没有新闻")
end if
%>
<tr bgcolor="#FFFFFF">
<td height="41" colspan="6"><div align="right">共<%= maxpage %>页 当前页:<%= requestpage %> <a href="news.asp?p=<%=requestpage-1%>">上一页</a> <a href="news.asp?p=<%=requestpage+1%>">下一页</a></div></td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -