<% If IsObject(Session("epictures")) Then Set conn = Session("epictures") Else set conn = Server.CreateObject("ADODB.Connection") conn.Open "epictures","sa" Set Session("epictures") = conn End If busca=request.form("txtName") indice=request.querystring("i") if busca="" then busca=request.querystring("buscar") end if cadena1="select count(*) as total from fotos where categoria like '%"& busca & "%' or nombre like '%"& busca & "%'" cadena="select id,codfoto,nombre,Categoria from fotos where categoria like '%"& busca & "%' or nombre like '%"& busca & "%'" set rs=conn.execute(cadena1) total=rs("total") if (rs("total")mod 15) >0 then numpages= total\15 +1 else numpages= total\15 end if rs.close set rs=conn.execute(cadena) if indice =0 then indice=1 else rs.move indice end if %> Ecuador-Pictures - Search
Results for: <%=busca%>
<% conta=0 page=1 nitem=0 do while not rs.eof and page<=5 conta=0 %> <% url="http://www.ecuador-pictures.org/" do while not rs.eof and conta <3%> <% destino="http://www.ecuador-pictures.com/viewphoto.asp?i=" & rs("codfoto") %> <%conta=conta+1%> <%rs.movenext%> <% if rs.eof then if conta= 1 or conta=2 then %> <% end if end if %> <%loop%>

" border="0">
<%=rs("nombre")%><%nitem=rs("id")%>

<% if not rs.eof then rs.movenext end if page=page+1 loop i=1 nitem=-15 %>


Result Pages: <%do while i<=numpages%> <%=i%>  <%i=i+1%> <%nitem=nitem+15%> <%loop%>