推薦:解讀ASP程序執行SQL語句時防止注入攻擊的問題以下是一個簡單的用戶更改密碼的代碼--------------------- username=request(user_name) pwd=request(pwd) username=replace(username,','') pwd=replace(pwd,','') sql=updatetbl_testsetpwd='pwd'whereuid='username' setrs=
<!--#include file=conn.asp-->
<html><head><TITLE>分頁測試</TITLE><LINK href=inc/style.css type=text/css rel=stylesheet></head>
<%strHead=strHead&<html>
strHead=strHead&<head>
strHead=strHead&<TITLE>分頁測試</TITLE>
strHead=strHead&<LINK href=inc/style.css type=text/css rel=stylesheet>
strHead=strHead&</head>
%>
<%
sql=select * from news
set rs=server.createObject(ADODB.Recordset)
rs.open sql,conn,1,1
%><%
rs.pagesize=2
totalpage=rs.pagecount
rs.close
set rs=nothing
for j=1 to totalpage
sql=select * from news
set rs=server.createObject(ADODB.Recordset)
rs.open sql,conn,1,1
whichpage=j
rs.pagesize=2
totalpage=rs.pagecount
rs.absolutepage=whichpage
howmanyrecs=0
%><%
str0=
str0=str0&</p>
str0=str0&<table bgcolor=#cecfce align=center border=0 width=800 cellpadding=2 cellspacing=1>
%><%
do while not rs.eof and howmanyrecs<rs.pagesize
%><%
str0=str0&<tr bgcolor=#f7f7f7>
str0=str0&<td bgcolor=#f7f7f7 align=center>&rs(0)&</td>
str0=str0&<td bgcolor=#f7f7f7 align=center>&rs(1)&</td>
str0=str0&<td bgcolor=#f7f7f7 align=center>&rs(2)&</td>
str0=str0&<td bgcolor=#f7f7f7 align=center>&rs(3)&</td>
str0=str0&</tr>
%><%
rs.movenext
howmanyrecs=howmanyrecs+1
loop
rs.close
set rs=nothing
%><%str0=str0&</table>
%>
分享:揭秘asp常用函數庫大全'-----------------FLYSOBlogASP站點開發常用函數庫------------------ 'OpenDB(vdata_url)--------------------打開數據庫'getIp()-------------------------------得到真實IP 'getIPAdress(sip)------------------------查找ip對應的真實地址'IP2Num
共2頁上一頁12下一頁