Örnek bir uygulama

<%

if(request.QueryString("id")<>"")then
cat_id=cint(request.QueryString("id"))
else
response.Redirect("index.asp")
end if

if(cat_id<=0)then
response.Redirect("index.asp")
end if

rs2.open "SELECT * FROM tblkategori WHERE id=" & cat_id,adocon
if(rs2.eof)then
rs2.close
response.Redirect("index.asp")
end if

intPageSize=40

TEL=""
ADSOYAD=""
X=""
BASLIK=""
EPOSTA=""

Q_STRING=""

ReDim DETAYLAR(11)

for i=1 to 11

DETAYLAR(i)=""

if(request.QueryString("FIELD" & i)<>"")then
Q_STRING=Q_STRING & "&FIELD" & i & "=" & Server.URLEncode(formatSQLInput(trim(request.QueryString("FIELD" & i))))
DETAYLAR(i)=formatSQLInput(trim(request.QueryString("FIELD" & i)))
end if

if(request.form("FIELD" & i)<>"")then
Q_STRING=Q_STRING & "&FIELD" & i & "=" & Server.URLEncode(formatSQLInput(trim(request.form("FIELD" & i))))
DETAYLAR(i)=formatSQLInput(trim(request.form("FIELD" & i)))
end if

next

if(request.QueryString("EPOSTA")<>"")then
EPOSTA=trim(request.QueryString("EPOSTA"))
end if

if(request.form("EPOSTA")<>"")then
EPOSTA=trim(request.form("EPOSTA"))
end if

if(request.QueryString("BASLIK")<>"")then
BASLIK=trim(request.QueryString("BASLIK"))
end if

if(request.form("BASLIK")<>"")then
BASLIK=trim(request.form("BASLIK"))
end if


if(request.QueryString("ADSOYAD")<>"")then
ADSOYAD=trim(request.QueryString("ADSOYAD"))
end if

if(request.form("ADSOYAD")<>"")then
ADSOYAD=trim(request.form("ADSOYAD"))
end if

if(request.QueryString("X")<>"")then
X=trim(request.QueryString("X"))
end if

if(request.form("X")<>"")then
X=trim(request.form("X"))
end if

if(request.QueryString("TEL")<>"")then
TEL=trim(request.QueryString("TEL"))
end if

if(request.form("TEL")<>"")then
TEL=trim(request.form("TEL"))
end if
%>
<%
id= REQUEST.QUERYSTRING("id" )
IF Not IsNumeric(REQUEST.QUERYSTRING("id" ) ) THEN
response.redirect("index.asp")
END IF
%>
------------> devamı

<%
		SQL="SELECT tblilanlar.id,tblilanlar.title,tblilanlar.adsoyad,X,tblilanlar.email,tblilanlar.tel,tblilanlar.tarih,tblilanlar.valid,tblilanlar.tur,tblilanlar.field1,tblilanlar.field2,tblilanlar.field3,tblilanlar.field4,tblilanlar.field5,tblilanlar.field6,tblilanlar.field7,tblilanlar.field8,tblilanlar.field9,tblilanlar.field10,tblilanlar.field11 FROM tblilanlar WHERE tblilanlar.tur=" & cat_id 
		
		if(ADSOYAD<>"")then
		SQL=SQL & " AND tblilanlar.adsoyad like '%" & ADSOYAD & "%'"
		end if

		if(X<>"")then
		SQL=SQL & " AND tblilanlar.X like '%" & X & "%'"
		end if
		
		if(EPOSTA<>"")then
		SQL=SQL & " AND tblilanlar.email like '%" & EPOSTA & "%'"
		end if
		
		if(BASLIK<>"")then
		SQL=SQL & " AND tblilanlar.title like '%" & BASLIK & "%'"
		end if
		
		if(TEL<>"")then
		SQL=SQL & " AND tblilanlar.tel like '%" & TEL & "%'"
		end if
		
		for j=1 to 11
		
			if(DETAYLAR(j)<>"")then
			
				if(rs2("field" & j & "t")=0)then		
				SQL=SQL & " AND tblilanlar.field" & j & "='1'"	
				elseif(rs2("field" & j & "t")=1)then	
				SQL=SQL & " AND tblilanlar.field" & j & " like '%" &  DETAYLAR(j) & "%'"
				elseif(rs2("field" & j & "t")=2)then	
				SQL=SQL & " AND tblilanlar.field" & j & " like '%" &  DETAYLAR(j) & "%'"				
				end if
			
			end if
		
		next
		
		SQL=SQL & " ORDER BY tblilanlar.tarih DESC;"
		
		 rs1.open SQL ,adocon
		
		dim recordarray,PAGE,intTotalRecordsPages,intTotalRecords,intEndPosition
				dim intStartPosition,intCurrentRecord
				
				  		
				
				if request.QueryString("PAGE")<>"" then
				PAGE=cint(request.QueryString("PAGE"))
				else
				PAGE=1
				end if
				
				if not  rs1.eof then
				recordarray=rs1.getrows()
				intTotalRecords=ubound(recordarray,2)+1
				else
				intTotalRecords=0				
				end if


				rs1.close
				
				intTotalRecordsPages=intTotalRecords\intPageSize
				
				If intTotalRecords Mod intPageSize > 0 OR intTotalRecordsPages = 0 Then intTotalRecordsPages = intTotalRecordsPages + 1
		
				'Start position
				intStartPosition = ((PAGE - 1) * intPageSize)	
				
				'End Position
				intEndPosition = intStartPosition + intPageSize
				
				if(intEndPosition>intTotalRecords) then intEndPosition=intTotalRecords
				
		
				'Get the start position
				intCurrentRecord = intStartPosition
		
				
		
		
		if intTotalRecords=0 then
		%><tr>
		  <td colspan="4" bgcolor="#00D000"><font color="#FFFFFF"><strong>Henüz ilan girilmemiş. </strong>
			</font></td>
		</tr>
		<%
		end if

		
		dim i
		  i=0
		  Do While intCurrentRecord < intEndPosition 
		 
		%>
		<tr <%if i mod 2<>0 then%> bgcolor="#E9EFFE"<%else%>bgcolor="#DBE4FD"<%end if%>>



<td width="229" bgcolor="#FFFFFF"><a href="ilan.asp?id=<%=recordarray(0,intCurrentRecord)%>"><%=recordarray(1,intCurrentRecord)%></a></td>
	        <td width="217" bgcolor="#FFFFFF">
			<p align="center"><font color="#D25400" size="4"><%=(recordarray(3,intCurrentRecord))%></font></td> 
		    <td width="134" bgcolor="#FFFFFF"><%=(recordarray(6,intCurrentRecord))%></td>
		</tr>
		<%
		
				  i=i+1
		 intCurrentRecord = intCurrentRecord + 1
		  Loop

	  
	  %>

Önceki sayfa sonraki sayfa hesabı --------->

		        <div align="right">
				  <p align="left"><%if PAGE>1 then%>          
				  <a href="cat.asp?pagecount=<%=intPageSize%>&action=list&id=<%=cat_id%>&PAGE=<%=PAGE-1%>&TEL=<%=TEL%>&BASLIK=<%=BASLIK%>&EPOSTA=<%=EPOSTA%>&ADSOYAD=<%=ADSOYAD%><%=Q_STRING%>">
					Önceki Sayfa</a>          
				  <%else%>
				  
				  <%end if%>
					  <%if PAGE <> intTotalRecordsPages then%><a href="cat.asp?pagecount=<%=intPageSize%>&action=list&id=<%=cat_id%>&PAGE=<%=PAGE+1%>&TEL=<%=TEL%>&BASLIK=<%=BASLIK%>&EPOSTA=<%=EPOSTA%>&ADSOYAD=<%=ADSOYAD%><%=Q_STRING%>">Sonraki 
					Sayfa </a><%else%><%end if%>

-------> table den sonra
<%
rs2.close
%>
<%
Private Function formatSQLInput(ByVal strInputEntry)

	'Remove malisous charcters from sql
	strInputEntry = Replace(strInputEntry, """", "", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "'", "''", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "[", "[", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "]", "]", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, "<", "&lt;", 1, -1, 1)
	strInputEntry = Replace(strInputEntry, ">", "&gt;", 1, -1, 1)
	
	'Return
	formatSQLInput = strInputEntry
End Function
%>