Modificare il file:
\Ricerca\search.asp
<% Set prodricer = Server.CreateObject("ADODB.Recordset") prodricer.ActiveConnection = MM_ecommerce_STRING prodricer.Source = "SELECT * FROM Prodotti WHERE "&Request.QueryString("campo")&" LIKE '%" + Request.QueryString("cosa") + "%'" prodricer.CursorType = 0 prodricer.CursorLocation = 2 prodricer.LockType = 1 prodricer.Open() prodricer_numRows = 0 %> <% Repeat1__numRows = -1 Repeat1__index = 0 prodricer_numRows = prodricer_numRows + Repeat1__numRows %> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>E-commerce - Daviduccio.it</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link href="../CSS/style.css" rel="stylesheet" type="text/css"> <script language="javascript"> function svuota() { document.form1.cosa.value=""; } </script> </head> <body> <table width="0%" border="0"> <tr> <td><div align="center" class="Stile1"> <table width="560" border="0"> <tr> <td height="19" bgcolor="#efefef"><div align="right" class="Stile3"><strong>Pagina di ricerca </strong></div></td> </tr> <tr> <td><p> </p> <form name="form1" method="get" action=""> <table border="0" class="Stile3"> <tr> <td>Cerca:</td> <td><input name="cosa" type="text" class="Stile3" id="cosa" onFocus="svuota()" value="<%=Request.QueryString("cosa")%>" size="30"></td> <td><select name="campo" class="Stile3" id="campo"> <option value="Nome" <%If (Not isNull(Request.QueryString("campo"))) Then If ("Nome" = CStr(Request.QueryString("campo"))) Then Response.Write("SELECTED") : Response.Write("")%>>Nel Nome</option> <option value="Descrizione" <%If (Not isNull(Request.QueryString("campo"))) Then If ("Descrizione" = CStr(Request.QueryString("campo"))) Then Response.Write("SELECTED") : Response.Write("")%>>Nella Descrizione</option> <option value="Marca" <%If (Not isNull(Request.QueryString("campo"))) Then If ("Marca" = CStr(Request.QueryString("campo"))) Then Response.Write("SELECTED") : Response.Write("")%>>Nella Marca</option> <option value="Classe" <%If (Not isNull(Request.QueryString("campo"))) Then If ("Classe" = CStr(Request.QueryString("campo"))) Then Response.Write("SELECTED") : Response.Write("")%>>Nella Categoria</option> </select></td> <td><input name="Submit" type="submit" class="Stile3" value="Cerca"></td> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> </tr> </table> <input name="az" type="hidden" id="az" value="ricerca"> </form></td> </tr> </table> <% If Not prodricer.EOF Or Not prodricer.BOF Then %> <table width="575" border="0" class="Stile3"> <tr bgcolor="#CCCCCC"> <td>Nome</td> <td width="350">Descrizione</td> <td>Prezzo</td> </tr> <tr> <td> </td> <td width="350"> </td> <td> </td> </tr> <% While ((Repeat1__numRows <> 0) AND (NOT prodricer.EOF)) %> <tr bgcolor="<% If (Repeat1__numRows Mod 2) Then Response.Write("#E0DFE3") Else Response.Write("#FFFFFF") End IF %>"> <td><div align="left"><a href="?az=prod&IDpr=<%=(prodricer.Fields.Item("ID").Value)%>&fcampo=Marca&fcosa=<%=(prodricer.Fields.Item("Marca").Value)%>&cosa=<%=Request.QueryString("cosa")%>&campo=<%=Request.QueryString("campo")%>"><strong><%=(prodricer.Fields.Item("Nome").Value)%></strong></a></div></td> <td width="350"><div align="left"><% des=(prodricer.Fields.Item("Descrizione").Value) if len(des) > 50 then response.Write(mid(des,1,50)&"...") else response.Write(des) end if%></div></td> <td><div align="left"><%=formatcurrency((prodricer.Fields.Item("Prezzo").Value))%></div></td> </tr> <% Repeat1__index=Repeat1__index+1 Repeat1__numRows=Repeat1__numRows-1 prodricer.MoveNext() Wend %> </table> <% End If ' end Not prodricer.EOF Or NOT prodricer.BOF %> </div></td> </tr> </table> </body> </html> <% prodricer.Close() Set prodricer = Nothing %>
[
Íàçàä
]