人人做人人澡人人爽欧美,国产主播一区二区,久久久精品五月天,羞羞视频在线观看免费

當(dāng)前位置:蘿卜系統(tǒng)下載站 > 技術(shù)開發(fā)教程 > 詳細(xì)頁面

動(dòng)感首頁更新完成之4 ------ 首頁顯示篇

動(dòng)感首頁更新完成之4 ------ 首頁顯示篇

更新時(shí)間:2022-09-09 文章作者:未知 信息來源:網(wǎng)絡(luò) 閱讀次數(shù):


index.asp

'讀入數(shù)據(jù)庫(kù)鏈接!
<!--#include file="articleconn.asp"-->
<html>
<%
'每頁最大顯示數(shù)為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動(dòng)感在線</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>站 務(wù) 公 告</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">查詢關(guān)鍵字<font color="#FF0000"><%=keyword%></font>
</div>
</td>
</tr>
<tbody>
<tr>
<td width="27%" align="right">請(qǐng)輸入搜索字符: </td>

<td valign=center width="54%" align="center">
<input class=TextBorder maxlength=25
name=keyword size=26>
&nbsp;&nbsp;</td>
<td valign=buttom width="19%" align="left">
<input alt=站內(nèi)搜索 border=0
name=submit src="/article/UploadPic/200671952024896.gif" type=image>
</td>
</tr>
</tbody>
</table>
</form>
<p align="left"><%
'打開數(shù)據(jù)庫(kù)內(nèi)容安ARTICLEID的倒數(shù)排列!
'title like '%"&keyword&"%' 為對(duì)搜索字的查找,空者表示全部!
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

'判斷數(shù)據(jù)庫(kù)是否為空!如果為空顯示'還 沒 有 任 何 文 章'

if rs.eof and rs.bof then
response.write "<p align='center'> 還 沒 有 任 何 文 章</p>"
else
'下面是對(duì)文章數(shù),每頁顯示數(shù)的判斷!大家可作其它程序的參考!!
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,"index.asp"
showContent
showpage totalput,MaxPerPage,"index.asp"
else
currentPage=1
showpage totalput,MaxPerPage,"index.asp"
showContent
showpage totalput,MaxPerPage,"index.asp"
end if
end if
rs.close
end if

set rs=nothing
conn.close
set conn=nothing


sub showContent
dim i
i=0

%> </p>

<table border="0" cellspacing="0" bordercolorlight="#000000" bordercolordark="#FFFFFF" cellpadding="0" vspace="10" hspace="40" align="center" width="80%">

'循環(huán)輸出數(shù)據(jù)庫(kù)中的數(shù)據(jù),一直到結(jié)束!

<tr> <%do while not rs.eof%>
<tr>

<td colspan="2"><font color="#000099">○</font> <a '<%rs("xxx")%>就是數(shù)據(jù)庫(kù)要顯示的內(nèi)容是編寫ASP的關(guān)鍵
'這個(gè)動(dòng)作是對(duì)程序的目的,即得出顯示結(jié)果!
href="<%=rs("url")%>" target="_blank"><%=rs("title")%></a>
<i><font color="#FF0000">(<%=rs("dateandtime")%>)</font></i></td>
</tr>
<tr>

<td width="550" colspan="2"><%=rs("content")%> <br>
<br>
</td>
</tr>
<% i=i+1
if i>=MaxPerPage then exit do
rs.movenext
loop
%>
</table>

<%
end sub

'大家看到的上頁下頁就是從這里得到的.可作其它程序的參考!
function showpage(totalnumber,maxperpage,filename)
dim n
if totalnumber mod maxperpage=0 then
n= totalnumber \ maxperpage
else
n= totalnumber \ maxperpage+1
end if
response.write "<form method=Post action="&filename&">"
response.write "<p align='center' vAlign='bottom'>&gt;&gt;分頁&nbsp;"
if CurrentPage<2 then
response.write "<font color='999966'>首頁 上一頁</font>&nbsp;"
else
response.write "<a href="&filename&"?page=1&>首頁</a>&nbsp;"
response.write "<a href="&filename&"?page="&CurrentPage-1&">上一頁</a>&nbsp;"
end if
if n-currentpage<1 then
response.write "<font color='999966'>下一頁 尾頁</font>"
else
response.write "<a href="&filename&"?page="&(CurrentPage+1)
response.write ">下一頁</a> <a href="&filename&"?page="&n&">尾頁</a>"
end if
response.write "&nbsp;頁次:<strong><font color=red>"&CurrentPage&"</font>/"&n&"</strong>頁 "
response.write "&nbsp;共<b>"&totalnumber&"</b>篇文章 <b>"&maxperpage&"</b>篇文章/頁 "
response.write " &nbsp;轉(zhuǎn)到:<input class=TextBorder style='TEXT-ALIGN: center' type='text' name='page' size=2 maxlength=10 class=smallInput value="&currentpage&">"
response.write " &nbsp;&nbsp;<input alt=頁面跳轉(zhuǎn) name='submit' src='http://www.okasp.com/images/goto.gif' type='image'></span></p></form>"

end function


%> </td>
</tr>
</table>
</td>
</tr>
</table>
'版權(quán)信息!不作解釋了!
<p align="center">《<a target="_blank">ASP動(dòng)感在線</a>》編輯制作</p>
</body>
</html>

大家注意的是兩點(diǎn):
1.個(gè)位可參照上面的程序舉一反三!
2.<%=rs("xxx")及顯示你txturl,txttitle等的內(nèi)容,這是學(xué)ASP關(guān)鍵所在,這一點(diǎn)如果明白了!學(xué)ASP差不多到了一個(gè)新的境界!
(出處:熱點(diǎn)網(wǎng)絡(luò))

溫馨提示:喜歡本站的話,請(qǐng)收藏一下本站!

本類教程下載

系統(tǒng)下載排行

網(wǎng)站地圖xml | 網(wǎng)站地圖html
主站蜘蛛池模板: 灵丘县| 福海县| 乐山市| 保亭| 内江市| 酒泉市| 临西县| 皋兰县| 云阳县| 弥勒县| 萍乡市| 肥城市| 泰安市| 巴林右旗| 鞍山市| 越西县| 神木县| 丹东市| 墨脱县| 瑞安市| 贵德县| 庄河市| 青州市| 荆州市| 丽江市| 依安县| 红河县| 万山特区| 天长市| 沂南县| 元阳县| 砚山县| 申扎县| 汽车| 松江区| 巨野县| 星子县| 金秀| 礼泉县| 兴城市| 日喀则市|