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

📄 news.asp

📁 二手书籍系统
💻 ASP
字号:
<!--#include file=inc/conn.asp-->
<%
function ReplaceBadChar(strChar)
	if strChar="" then
		ReplaceBadChar=""
	else
		ReplaceBadChar=replace(replace(replace(replace(replace(replace(replace(replace(replace(strChar,"'",""),"*",""),"?",""),"(",""),")",""),"<",""),";",""),".",""),"'","")
	end if
end function
%>
<script language="JavaScript">
function closewindow()
{ 
  window.close();
}
</script>
<link href="inc/style.css" rel="stylesheet" type="text/css">
    <% 
    dim id,rs,sql
    id=trim(request("id"))
    id=ReplaceBadChar(id)
	if IsNumeric(id) <> true then
		Response.Write "<script language='javascript'>alert('请不要黑我的站呀,老大!');history.back();</script>" 
		response.end
	end if	
	if id="" then
    call list()
	response.end
	end if
    set rs=server.createobject("adodb.recordset")
    sql="select * from [news] where id="&cstr(id)
    rs.open sql,conn,1,1
    if rs.eof and rs.bof then
	response.write "没有新闻"
	response.end
   	end if
   	function HTMLEncode(fString)
    fString = replace(fString, ">", "&gt;")
    fString = replace(fString, "<", "&lt;")
    fString = Replace(fString, CHR(13), "")
    fString = Replace(fString, CHR(10) & CHR(10), "</P><P>")
    fString = Replace(fString, CHR(10), "<BR>")
    HTMLEncode = fString
    end function
   	%>
   	<title><%=rs("biaoti")%>-书友会</title>
<body topmargin="3">

<div align="center">
  <center>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#FF9933" width="521" height="162">
  <tr>
    <td width="519" height="162">
    <div align="center">
      <center>
    <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="99%">
      <tr>
        <td width="33%">
        <p align="right">
        <a target="_blank" href="index.asp">
        <img border="0" src="image/ad_top_468.gif" align="center"></a></td>

      <tr>
        <td width="100%" colspan="3">
        <p align="center"><span style="font-size: 11pt; font-weight: 700"><%=rs("biaoti")%></span></td>
      </tr>
      <tr>
   
        <td width="33%" height="18" align=right>
        <font color="#C0C0C0" size="2"><%=rs("data")%></font></td>
      </tr>
      <tr>
        <td width="100%" colspan="3"><font size="2">&nbsp;&nbsp;<%=HTMLEncode(rs("neirong"))%></font></td>
      </tr>

    </table>
      </center>
    </div>
    </td>
  </tr>
</table>
  </center>
</div>
<%
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
<%sub list()
dim k
set rs=server.createobject("adodb.recordset")
sql="select * from [news] order by id desc"
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "没有新闻"
response.end
end if
k=0
%>
<div align="center">
  <center>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#FF9933" width="521" height="13">
  <tr>
    <td width="521" height="13">
    <div align="center">
      <center>
    <table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="99%">

      <tr>
        <td width="2%"> </td>
        <td width="6%" height="20">
        <p align="center"><font size="2">编号</font></td>
        <td width="64%" height="20"><font size="2">标题</font></td>
        <td width="28%" height="20"><font size="2">发布时间</font></td>
      </tr>
      <%do while not rs.eof%><span style="font-size: 9pt">
      <tr>
        <td width="2%"> </td>
        <td width="6%" height="20"> </span>
        <p align="center">
        <font size="2"><%=k+1%></font></td>
        <td width="64%" height="20"><a href="javascript:win=open('gonggao.asp?id=<%=rs("id")%>','offer','width=560,height=450,status=no,menubar=yes,scrollbars=yes,top=0,left=0'); win.focus()">
        <font size="2"><%=rs("biaoti")%></font></a></td>
        <td width="28%" height="20"><font size="2" color="#C0C0C0"><%=rs("data")%></font></td>
      </tr>
      <%
      rs.movenext
      k=k+1
      loop
      %>

    </table>
      </center>
    </div>
    </td>
  </tr>
</table>
  </center>
</div>
<%end sub%>

⌨️ 快捷键说明

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