io Parto da questo, che è uno script che ho realizzato, ma che ricera in modo classico...
Potreste aiutarmi su questo:
Al quale vorrei aggiungere i campi 2 e 3 come detto primacodice:<%@LANGUAGE = JScript%> <% Response.Buffer = true; var Cn = new ActiveXObject("ADODB.Connection"); Cn.Open("driver={Microsoft Access Driver (*.mdb)};dbq=" + Server.MapPath("mdb-database/cerca.mdb")); var testo = new String(Server.HTMLEncode(Request.Form("cerca"))); var r_testo = testo.replace(/'/g,"''"); var cerca = r_testo.split(" "); // Tutte le parole chiave devono essere separate da uno spazio vuoto var sql = "SELECT * FROM risultati WHERE "; for (var i=0; i<cerca.length; i++) { if (i > 0) sql += " AND"; sql += " parole_chiave LIKE '%" + cerca[i] + "%'"; } sql += " ORDER BY titolo"; var Mostra = Cn.Execute(sql); %> <html> <head> <title>Cerca</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link href="css/file.css" rel="stylesheet" type="text/css"> <body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0"> <div align="center"> <table width="100%" height="371" border="0" cellpadding="0" cellspacing="0"> <tr> <td height="20" valign="top" bgcolor="#000099"> <div align="center"> <font color="#FFFFFF" size="4">Motore di Ricerca</font></p> </div></td> </tr> <tr> <td height="351" valign="top" bgcolor="#E6FAFF"> <div align="center"> <form method="post" action="cerca.asp"> <div align="left"> <input type="text" name="cerca" size="15" value="<%cerca != "undefined" ? Response.Write(testo) : Response.Write("")%>"> <input name="submit" type="submit" value="Cerca"> </div> </form> <div align="right"> <table width="100%" height="1%" border="0" cellpadding="0" cellspacing="0"> <tr> <td width="3%" height="19"> <div align="right"><font color="#FF0000"> <%if (testo != "undefined") {%> <font color="#000099">Ricerca "</font><%=testo%><font color="#000099">"</font></font></div></td> </tr> <tr> <td height="270" valign="top" bgcolor="#FFFFFF"> <% if (testo == "" || testo == "undefined" || testo.charAt(0) == " ") { Response.Write(" </p>"); } else if (Mostra.EOF) { Response.Write(" Spiacenti, ma nessun sito trovato con il termine richiesto</p>"); } else { while (!Mostra.EOF) { with (Response) { Write("<table border=0>"); Write("<tr>"); Write("<td>"); Write("" + Mostra("titolo") + " "); Write(""); Write("[img]" + Mostra("url_foto") + "[/img]"); Write("</td><td>") Write(Mostra("descrizione")); Write("</td></tr></table>"); } Mostra.MoveNext(); } } %> <%}%> </td> </tr> <tr> <td height="19" bgcolor="#000099"></td> </tr> </table> </div> </div></td> </tr> </table> </div> </body> </html> <%Cn.Close()%>
Grazie a tutti per la collaborazione