📄 newswind.asp
字号:
<html>
<head>
<title>新闻</title>
<link rel="stylesheet" type="text/css" href="news.css">
</head>
<%
id=trim(request("id"))
set conn=server.createobject("ADODB.CONNECTION")
conn.open "DBQ="+server.mappath("news.mdb")+";DRIVER={Microsoft Access Driver (*.mdb)};"
set rs=server.createobject("adodb.recordset")
sql="SELECT * from news where ID="&id
rs.open sql,conn,1,1
if rs.eof then
response.write "错误的ID号"
rs.close
set rs=nothing
conn.close
set conn=nothing
response.end
else%>
<table width="100%" HEIGHT=100% border="1" cellspacing="0" cellpadding="0" bordercolorlight="#000000" bordercolordark="#FFFFFF">
<tr bgcolor="#FAD185">
<td height=20 align=center><b><%=rs("title")%></b></td>
</tr>
<tr>
<td valign=top>
<%'如果type=0,代表是文本类型信息,若type=1,代表是链接信息%>
<%if rs("type")=0 then%>
<p><%=replace(rs("content"),chr(13)&chr(10),"<p>")%>
<%else%>
<iframe id=BoardTitle name=newscon style="HEIGHT:100%; VISIBILITY: inherit; WIDTH:100%; Z-INDEX: 2" scrolling=auto frameborder=0 src="<%=rs("content")%>" ></iframe></td>
<%end if%>
</tr>
</table>
<br><b>相关新闻:</b><ul>
<%
sql="SELECT * from news where ID<>"&id&" and keyw='"&rs("keyw")&"' order by ID desc"
rs.close
rs.open sql,conn,1,1
do while not rs.eof
%>
<li><a href=newswind.asp?id=<%=rs("ID")%>><u><%=rs("title")%></u></a>--<%=rs("write")%>【<%=rs("times")%>】
<%
rs.movenext
loop
rs.close
conn.close
end if
%></ul>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -