asp生成HTM靜態(tài)列表分頁(含代碼,已測(cè)試成功)(2)_ASP教程
推薦:解讀ASP程序執(zhí)行SQL語句時(shí)防止注入攻擊的問題以下是一個(gè)簡(jiǎn)單的用戶更改密碼的代碼 --------------------- username=request(user_name) pwd=request(pwd) username=replace(username,’,’’) pwd=replace(pwd,’,’’) sql=updatetbl_testsetpwd=’pwd’whereuid=’username’ setrs=
<%
'分頁部分
ref=""
ref=ref&"<br>"
ref=ref&"<table bgcolor=#cecfce align=center border=0 width=800 cellpadding=0 cellspacing=1> "
ref=ref&"<tr bgcolor=#f7f7f7>"
ref=ref&"<td> "
ref=ref&"<b>Pages: " & j & " / " & totalpage &"</b>"
ref=ref&"</td>"
ref=ref&"<td> "
ref=ref&"<a href=list_1.html"&">" & "<FONT face=Webdings>9</FONT>" & "</a> "
if whichpage=1 then
ref=ref&"<FONT face=Webdings>7</FONT>"
else
ref=ref&"<a href=list_"&j-1&".html"&">" & "<FONT face=Webdings>7</FONT>" & "</a> "
end if
for counter=1 to totalpage
ref=ref&"<a href=list_"&counter&".html"&">[" & counter & "]</a>"
ref=ref& " "
if counter mod 10 = 0 then
ref=ref& "<br>"
end if
next
if (whichpage>totalpage or whichpage=totalpage) then
ref=ref&"<FONT face=Webdings>8</FONT>"
else
ref=ref&"<a href=list_"&j+1&".html"&">" & "<FONT face=Webdings>8</FONT>" & "</a> "
end if
ref=ref&"<a href=list_"&totalpage&".html"&">" & "<FONT face=Webdings>:</FONT>" & "</a> "
Dim fso,f
Dim strTitle,strContent,strOut
'創(chuàng)建文件系統(tǒng)對(duì)象
Set fso=Server.CreateObject("Scripting.FileSystemObject")
Set f=fso.CreateTextFile(Server.MapPath("list_"&j&".html"),true)
'寫入網(wǎng)頁內(nèi)容
f.WriteLine strHead&str0&ref
f.close
response.write "正在生成第"&j&"個(gè)頁面!<br>"
%><%
next%>
源代碼,已測(cè)試成功!
htmlpage_demo.rar
分享:揭秘asp常用函數(shù)庫大全’-----------------FLYSOBlogASP站點(diǎn)開發(fā)常用函數(shù)庫------------------ ’OpenDB(vdata_url)--------------------打開數(shù)據(jù)庫 ’getIp()-------------------------------得到真實(shí)IP ’getIPAdress(sip)------------------------查找ip對(duì)應(yīng)的真實(shí)地址 ’IP2Num
- asp FSO 讀寫文件本文件實(shí)現(xiàn)代碼
- asp中isNull、isEmpty和空字符串的區(qū)別
- asp獲取用戶真實(shí)IP地址的方法
- asp連接sqlserver數(shù)據(jù)庫實(shí)現(xiàn)代碼
- asp中正則表達(dá)式過濾html代碼函數(shù)
- asp中g(shù)et post提交表單區(qū)別
- 網(wǎng)頁模板:ASP內(nèi)建對(duì)象Request
- xmlhttp的open方法使用詳解
- ASP的常用的自定義函數(shù)大全
- asp中用for循環(huán)的一個(gè)小技巧
- eWebEditor v3.8 列目錄
- ASP無組件分頁實(shí)現(xiàn)思路及代碼
- 相關(guān)鏈接:
- 教程說明:
ASP教程-asp生成HTM靜態(tài)列表分頁(含代碼,已測(cè)試成功)(2)
。