Recommended: Interpret the problem of preventing injection attacks when ASP programs execute SQL statements The following is a simple code for changing the password for users --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
<!--#include file=conn.asp-->
<html><head><TITLE>Pagination Test</TITLE><LINK href=inc/style.css type=text/css rel=stylesheet></head>
<%strHead=strHead&<html>
strHead=strHead&<head>
strHead=strHead&<TITLE>Pagination Test</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 cellpacing=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>
%>
Share: Reveal the complete collection of commonly used function libraries for asp '-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
2 pages in total Previous page 12 Next page