asp生成HTM靜態列表分頁(含代碼,已測試成功)(2)_ASP教程
推薦:解讀ASP程序執行SQL語句時防止注入攻擊的問題以下是一個簡單的用戶更改密碼的代碼 --------------------- 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
'創建文件系統對象
Set fso=Server.CreateObject("Scripting.FileSystemObject")
Set f=fso.CreateTextFile(Server.MapPath("list_"&j&".html"),true)
'寫入網頁內容
f.WriteLine strHead&str0&ref
f.close
response.write "正在生成第"&j&"個頁面!<br>"
%><%
next%>
源代碼,已測試成功! htmlpage_demo.rar
解壓密碼:www.code-123.com分享:揭秘asp常用函數庫大全’-----------------FLYSOBlogASP站點開發常用函數庫------------------ ’OpenDB(vdata_url)--------------------打開數據庫 ’getIp()-------------------------------得到真實IP ’getIPAdress(sip)------------------------查找ip對應的真實地址 ’IP2Num
- 相關鏈接:
- 教程說明:
ASP教程-asp生成HTM靜態列表分頁(含代碼,已測試成功)(2)。