Ir para conteúdo

POWERED BY:

Arquivado

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

nonsense

na primeira página de uma loja

Recommended Posts

Opa, faz uma busca por Random, ou aleatório, pois tem uma postagem recente do gastão sobre isso!

Compartilhar este post


Link para o post
Compartilhar em outros sites

Ola meu amigosegue um exemplo<!--#include file="adovbs.inc"--><%' Get Current Page NumbersecurrentPage = Request( "currentPage" )IF currentPage = "" THEN currentPage = 1' Open Database ConnectionSet Con = Server.CreateObject( "ADODB.Connection" )Con.Open "DBQ=" & Server.MapPath("bandodedados.mdb") & ";Driver={Microsoft Access Driver (*.mdb)};"' Create Recordset ObjectSet RS = Server.CreateObject( "ADODB.Recordset" )RS.ActiveConnection = Con' Open with Static CursorRS.CursorType = adOpenStatic ' Show 5 Records a Page <===aqui você indica qtos registros quer exibir na paginaRS.PageSize = 6'Retrieve Records From TablemySQL = "SELECT * FROM Produto Order By PrecoVenda ASC"RS.Open mySQL'''' Começa aqui o código de BD não encontradoIf rs.Eof or rs.Bof then ' No categories found in DBResponse.Write "<body bgcolor='#FFFFD9'>"Response.Write "<div align=center>" Response.Write "<table border='0' cellpadding='0' cellspacing='0' width='100%'>"Response.Write "<tr>"Response.Write "<td width='100%' valign='top' align='center'><strong><font face='Verdana'><br><br><br><br>No Momento Não temos Produtos Cadastrados</font></strong></td>"Response.Write "</tr>"Response.Write "</table>"Response.Write "</center></div>" Else'''' Termina aqui o código de BD não encontrado' Set Current PageRS.AbsolutePage = cINT(currentPage) %><head><meta http-equiv="Content-Language" content="pt-br"><meta http-equiv="Content-Type" content="text/html; charset=windows-1252"><meta http-equiv="Pragma" content="no-cache"><link rel="stylesheet" href="loja.css" type="text/css"><title>::. Shopmedia - Loja Virtual .::</title></head><body><div align="center"><table align="center" border="0" cellpadding="0" width="100%" cellspacing="0" class="textopreto"><tr><td align="right" bgcolor="#FBFBFB"><p>Ver + Produtos:<%' Display Page NumberFor i = 1 to RS.PageCountIf i = cINT( currentPage ) THEN%>[<b><%=i%></b>] <%ELSEStrURL = Request.ServerVariables("URL") ''' Determina o endereço da URL%>[<a href="<%=StrURL%>?currentPage=<%=i%>"><%=i%></a>]<%End IfNext%></td></tr><tr><td align="right" height="20"></td></tr></table></div><div align="center"><table align="center" border="0" cellpadding="0" width="100%" height="" cellspacing="0" class="textopreto"><%Response.Write "<tr>"''' EXIBE QUATRO ITENS EM DUAS COLUNASi = 1rowCount = 0WHILE not RS.EOF and rowCount < RS.PageSizeSql = "Select * From Produto"Set rs2=con.Execute(Sql)Response.Write "<td width='50%' height='150' valign='top' align='left'>"Response.Write "<img border='0' src='upload/produto/"&rs("fotopequena")&"' align='left'>"Response.Write "<b>"&rs("nomeproduto")&"</b><br>"Response.Write " Preço: "&FormatCurrency(rs("precovenda"))&"<br>"Response.Write " Compre"Response.Write "<br><br>"Response.Write "</td>"If i = 2 Then 'DEFINE A QUANTIDADE DE COLUNASi = 0Response.Write "</TR>"End Ifi = i + 1Rs2.MoveNextrowCount = rowCount + 1RS.MoveNextWEND%></table></div><%rs2.closeRS.closecon.Closeset con=nothingset rs=nothingset rs2=nothingEnd if%></body></html>Espero que ajudeabracosMergulhador :blink:

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.