首頁顯示篇

來源:互聯網
上載者:User
顯示 index.asp

'讀入資料庫連結!
<!--#include file="articleconn.asp"-->
<html>
<%
'每頁最大顯示數為20
const MaxPerPage=20
dim totalPut
dim CurrentPage
dim TotalPages
dim i,j

dim typename
dim keyword
keyword=trim(request("keyword"))

if not isempty(request("page")) then
currentPage=cint(request("page"))
else
currentPage=1
end if

%>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>ASP動感線上</title>
<meta name="GENERATOR" content="Microsoft FrontPage 3.0">
<link rel="stylesheet" href="../css/style.css">
</head>
<body bgcolor="#FFFFFF">
<table width="90%" cellpadding="0" cellspacing="0" align="center">
<tr>
<td colspan="3" height="203">
<table border="1" width="100%" bordercolorlight="#000000" bordercolordark="#FFFFFF" cellpadding="0" cellspacing="0" align="center">
<tr bgcolor="#ACD6FF">
<td width="100%" height="20">
<p align="center"><font color="#000000"><b>站 務 公 告</b></font>
</td>
</tr>
<tr>
<td width="100%" height="152">
<form method="post" action="index.asp">
<br>
<font color="#FF0000"> </font>
<table border=0 cellpadding=0 cellspacing=0 width="54%" align="center">
<tr>
<td valign=center colspan="3" align="right">
<div align="center">查詢關鍵字<font color="#FF0000"><%=keyword%></font>
</div>
</td>
</tr>
<tbody>
<tr>
<td width="27%" align="right">請輸入搜尋字元: </td>

<td valign=center width="54%" align="center">
<input class=TextBorder maxlength=25
name=keyword size=26>
  </td>
<td valign=buttom width="19%" align="left">
<input alt=站內搜尋 border=0
name=submit src=http://www.163design.net/a/d/".images/search.gif" type=image>
</td>
</tr>
</tbody>
</table>
</form>
<p align="left"><%
'開啟資料庫內容安ARTICLEID的倒數排列!
'title like '%"&keyword&"%' 為對搜尋字的尋找,空者表示全部!
sql="select * from learning where title like '%"&keyword&"%' order by articleid desc"
dim sql,rs
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,1

'判斷資料庫是否為空白!如果為空白顯示'還 沒 有 任 何 文 章'

if rs.eof and rs.bof then
response.write "<p align='center'> 還 沒 有 任 何 文 章</p>"
else
'下面是對文章數,每頁顯示數的判斷!大家可作其它程式的參考!!
totalPut=rs.recordcount
totalPut=rs.recordcount
if currentpage<1 then
currentpage=1
end if
if (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage
else
currentpage= totalPut \ MaxPerPage + 1
end if

end if
if currentPage=1 then
showpage totalput,MaxPerPage,"index.asp"
showContent
showpage totalput,MaxPerPage,"index.asp"
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
showpage totalput,MaxPerPage,"inde



相關文章

E-Commerce Solutions

Leverage the same tools powering the Alibaba Ecosystem

Learn more >

Apsara Conference 2019

The Rise of Data Intelligence, September 25th - 27th, Hangzhou, China

Learn more >

Alibaba Cloud Free Trial

Learn and experience the power of Alibaba Cloud with a free trial worth $300-1200 USD

Learn more >

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。