Ir para conteúdo

POWERED BY:

Arquivado

Este tópico foi arquivado e está fechado para novas respostas.

designmix

paginação perder o valor

Recommended Posts

galera fiz uma paginação so que quando mando busca ele busca ai quando clico em next ele perde o valor de faz uma busca do banco todoalguem pode me ajudar

Compartilhar este post


Link para o post
Compartilhar em outros sites
<%if Request.QueryString("busca") = "localizar" then%>		<%		Dim sFiltro		Dim strSQL		Dim rs					   Session ("sexo")  = Request.form ("sexo")		  			nome		= Request.form ("nome")			cabelo	  = Request.Form("cabelo")			idade	   = Trim(Request.Form("idade"))			tipo		= Request.Form("tipo")			olhos	   = Request.Form("olhos")			pele		= Request.Form("pele")			profissao   = Request.Form("profissao")  			tipo_prof   = Request.Form("tipo_prof")			sFiltro = "WHERE " 		If nome <> "" Then		   sFiltro = sFiltro & "nome Like '%" & nome & "%' and "		end if				If cabelo <> "" Then		   sFiltro = sFiltro & "cabelo = '" & cabelo & "' and "		end if				If idade <> "" Then		   sFiltro = sFiltro & "idade = " & idade & " and "		end if				If tipo <> "" Then		   sFiltro = sFiltro & "tipo = '" & tipo & "' and "		end if				If olhos <> "" then 			sFiltro = sFiltro & "olhos like '%" & olhos & "%' and "		end if				If session ("sexo") <> "" Then 			sFiltro = sFiltro & "sexo like '%" & session ("sexo") & "%' and "		end if 		 		If pele <> "" Then		 	sFiltro = sFiltro & "pele like '%" & pele & "%' and "		 end if		 		If profissao <> "" then			sFiltro = sFiltro & "profissao like '%" & profissao & "%' and "		 end if 		 		 If tipo_prof <> "" then			sFiltro = sFiltro & "tipo_prof like '%" & tipo_prof & "%' and "		 end if 		 		if sFiltro = "WHERE " then		  sFiltro = ""		else		  SFiltro = left(sFiltro,len(sFiltro) - 4)		End if									 StrSQl = "SELECT COUNT(*) as total FROM `cadastro` "  & sFiltro			 Call abre_conexao		 Set rs_Busca = conn.Execute (StrSQl)				 numero_fotos = rs_Busca("total")	 			%>		<table width="96%" height="90" border="0" cellpadding="0" cellspacing="1">		  <tr>			<td width="53%" height="14" valign="top"></td>			<td width="47%" valign="top">						</td>		  </tr>		  <tr>			<td height="36" colspan="2" valign="top">			<table width="41" height="41" border="0" cellpadding="0" cellspacing="0" bgcolor="#ECE9D8">				<%		Resto = cdbl(int(numero_fotos)) mod 12				IF resto > 0 then 		   numero_paginas = numero_fotos / 12 + 1		Else		   numero_paginas = numero_fotos / 12		End If				if isNumeric(request.querystring("pagina")) then			pagina = request.querystring("pagina")		else 			  pagina = 1		end if					pagina = cdbl(int(pagina))				  				  	   if pagina < 1 or pagina > numero_paginas then		   pagina = 1		end if		 inicio = ((pagina * 12) - 12)	  		sqls = "SELECT * FROM cadastro " & sFiltro & " limit "& inicio &", 12"			Set rs = conn.Execute (sqls)		%>		<%		 if rs.EOF Then 		  %>			  nada encontrado		<% else %>				   <%					for l = 1 to 2			if not rs.EOF then			%>				<tr>				  <%			for c = 1 to 6			if not rs.EOF then				foto_pqna = "<img src='fotos_/"& rs("foto_p") &"' width='51' height='38' border='0'>"			%>				  <td nowrap="nowrap" class="tdFotos" ><a href="busca_visu.asp?id=<%=rs("id")%>"><%=foto_pqna%></a></td>				  <%			end if			if not rs.EOF then				rs.movenext			end if			next			%>				</tr>				<%			  end if		  next		  %>			</table></td>		  </tr>		  <tr>			<td align="right" style="padding-right: 8px;"><div align="left">			  <p> <%response.Write session ("sexo")%>				<% if pagina > 1 then %>				  <a href="busca_2.asp?busca=localizar&pagina=<%=(pagina - 1)%>" target="_self"><img src="back.gif" alt="Ir para a página anterior" width="42" height="13" border="0" /></a>				<% end if %>				<% if pagina < cdbl(int(numero_paginas)) then %>				  <a href="busca_2.asp?busca=localizar&pagina=<%=(pagina + 1)%>" target="_self"><img src="next.gif" alt="Ir para a próxima página" width="42" height="13" border="0" /></a>				<% end if %>			</p>			</div></td>		  </tr>		</table>		<%end if%>		  <%end if%>

Compartilhar este post


Link para o post
Compartilhar em outros sites

×

Informação importante

Ao usar o fórum, você concorda com nossos Termos e condições.