<% '#************************************# '# # '# 小山屋作文库 V1.0 # '# # '# 小山屋 http://www.xiaqoshanwu.com # '# 电子邮件 ss@xiaoshannwu.com # '# # '# 小山屋工作室 # '# # '#************************************# %> <% '下面这一行设置默认每页显示条数 thesize=10 '默认为10 dim pagesize,keyword,id,name,title,content,reply pagesize=Request("pagesize") keyword=request("keyword") if request("page")="" then curpage = 1 else curpage = cint(request("page")) end if ID=Request("id") %> <% if pagesize="0" or pagesize="" then pagesize=thesize set conn=server.createobject("adodb.connection") DBPath = Server.MapPath("#gs.asp") conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DBPath Set rs = Server.CreateObject("ADODB.Recordset") dim rs, sql set rs = server.createobject("adodb.recordset") dim curpage, strcate if ID <> "" then sql="select * from shici where id=" & request("id") rs.Open sql,conn,3,2 name=rs("name") title=rs("title") content=rs("content") reply=rs("reply") rs.close %> 《<%=title%>》 -<%=name%> [唐诗宋词赏析]

当前位置: 小山屋->小山书斋->古诗词赏析->


<%=title%>

<%=name%>

<% Response.Write changechr(cstr(content)) if reply<> "" then%>  

   ============

<%=changechr(reply)%> <%end if%>

<% keyword=name if keyword <> "" then keyword = replace(keyword,"'","") '过滤关键字 keyword = replace(keyword,"[","") keyword = trim(keyword) wherestr=" where name like '%" & trim(keyword) & "%'" end if sql2 = "SELECT * FROM shici " & wherestr & " ORDER BY id " rs.open sql2, conn, 1, 1 end if if rs.bof and rs.eof then rs.close response.write "
还没有符合条件的内容
" else dim i rs.pagesize = pagesize if rs.pagecount < curpage then rs.absolutepage=rs.pagecount curpage=rs.pagecount else rs.absolutepage = curpage end if %>
<%if rs("jj")<>"" then%> <%end if%> <% for i = 1 to rs.pagesize if i mod 2=1 then %> <%end if%> <% rs.movenext if rs.eof then i = i + 1 exit for end if next if not rs.eof then%> <% end if %>
 
  <%Response.Write changechr(cstr(rs("jj"))) %>
 
">更多<%=rs("name")%>的诗(词)  
  <%=i%>."><%=rs("title")%>  
   ……
<% rs.close end if set rs=nothing conn.Close set conn=nothing %>
 
 <% function changechr(str) changechr=replace(replace(replace(replace(str,"<","<"),">",">"),chr(13),"
")," "," ") end function %>