Visualizzazione dei risultati da 1 a 8 su 8

Discussione: ricerca + paginazione

  1. #1
    Utente di HTML.it
    Registrato dal
    Sep 2003
    Messaggi
    46

    ricerca + paginazione

    Ciao ragazzi ho un problema con la paginazione della ricerca... x effettuare la ricerca uso:

    parola=Request.Form("tipo_cat")
    parola = Replace ( parola, "'", "''" )

    id_categoria = request("tipo_cat")

    strSQL="SELECT * FROM archivio WHERE id_categoria LIKE '%"& parola &"%' ORDER BY ID DESC "

    una volta fatta la ricerca xò la paginazione mi torna all'archivio totale.. come faccio a passare la query ??

    come query uso questo:

    Response.Write "<a href=archivionews.asp?page=" & I & "><font face=""Arial"" style=""font-size: 12px"" color=""#FFFFFF""> " & I & "</font> </a> " & vbCRLF

  2. #2
    Utente di HTML.it
    Registrato dal
    Sep 2003
    Messaggi
    46
    ???HELP

  3. #3
    Moderatore di Annunci siti web, Offro lavoro/collaborazione, Cerco lavoro L'avatar di cavicchiandrea
    Registrato dal
    Aug 2001
    Messaggi
    26,133
    posta tutta la pagina della ricerca
    Cavicchi Andrea
    Problemi con javascript, jquery, ajax clicca qui

  4. #4
    Utente di HTML.it
    Registrato dal
    Sep 2003
    Messaggi
    46
    <%@Language="VBScript"%>


    <%
    Dim oRS, oConn
    NumPerPage=10
    If Request.QueryString("page") = "" Then
    iPageCurrent = 1
    Else
    iPageCurrent = CInt(Request.QueryString("page"))
    End If

    parola=Request.Form("tipo_cat")
    parola = Replace ( parola, "'", "''" )

    id_categoria = request("tipo_cat")

    strSQL="SELECT * FROM archivio WHERE id_categoria LIKE '%"& parola &"%' ORDER BY ID DESC "
    x = 1
    oRS.Open strSQL, oConn,1,3
    oRS.Pagesize = NumPerPage
    iPages=oRs.PageCount
    conta=oRS.RecordCount
    If iPageCurrent > iPages Then iPageCurrent = iPages
    If iPageCurrent < 1 Then iPageCurrent = 1
    If iPages <> 0 Then oRs.AbsolutePage = iPageCurrent

    if not oRS.Eof then

    %>




    </font>
    <div align="center">
    <center>
    <table width="560" cellspacing="0" border="1" style="border-collapse: collapse; border-left-width:0px; border-right-width:0px; border-top-width:0px" bordercolor="#C0C0C0" bgcolor="#FFFFFF" cellpadding="0" height="64">
    <tr>
    <td bgcolor="#5B0000" align="center" height="29" colspan="5" style="border-left: medium none #C0C0C0; border-right: medium none #C0C0C0; border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium" width="332">
    <form method="POST" action="archivionews.asp">
    <p align="left">
    <font color="#FFFFFF" style="font-size: 10pt" face="Arial">
    Scegli la categoria</font>
    <%

    cat = oRs("id_categoria")
    strSql = "SELECT * From categorie Order by tipo_cat"
    Set oRS2= oConn.Execute(strSql)

    Response.Write"<Select name=""tipo_cat"">"
    if cat = null then
    Response.Write " <option value="""">Tutte le categorie</option>"
    end if
    While Not oRs2.EOF
    Response.Write " <option value=""" & oRs2("ID") & """"

    If cat = oRs2("ID") Then
    Response.Write " selected"
    End If
    Response.Write ">" & oRs2("tipo_cat") & "</option>" & vbCRLF

    oRS2.MoveNext
    Wend
    Response.Write "</select>"

    oRS2.Close
    Set oRS2 = Nothing
    %>

    <input type="submit" value="Vai" name="B1" style="color: #FFFFFF; border: 1px solid #C0C0C0; background-color: #800000"></p>
    </td>
    <td bgcolor="#5B0000" align="center" height="31" colspan="3" style="border-left: medium none #C0C0C0; border-right: medium none #C0C0C0; border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium" width="224">
    <p align="right">
    <font face="Arial" color="#FFFF00" style="font-size: 9pt"> Ci sono
    <%=conta%>
    articoli presenti in Archivio </font></td>
    </tr>
    <tr>
    <td bgcolor="#800000" align="center" height="16" colspan="4" style="border-left: medium none #C0C0C0; border-right-style: none; border-right-width: medium; border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium">
    <font face="Arial" size="1" color="#FFFFFF">OPZIONE</font></td>
    <td bgcolor="#800000" align="center" height="22" width="246" style="border-style: none; border-width: medium">
    <font face="Arial" size="1" color="#FFFFFF">TITOLO</font></td>
    <td bgcolor="#800000" align="center" height="16" width="76" style="border-style: none; border-width: medium">
    <font face="Arial" size="1" color="#FFFFFF">CATEGORIA</font></td>
    <td bgcolor="#800000" align="center" height="16" width="35" style="border-style: none; border-width: medium">
    <font face="Arial" size="1" color="#FFFFFF">FOTO</font></td>
    <td bgcolor="#800000" align="center" height="16" width="114" style="border-left-style: none; border-left-width: medium; border-right: medium none #C0C0C0; border-top-style: none; border-top-width: medium; border-bottom-style: none; border-bottom-width: medium">
    <font face="Arial" size="1" color="#FFFFFF">DATA</font></td>
    </tr>
    <%

    iRecordsShown = 0
    Do While iRecordsShown < NumPerPage And Not oRS.EOF

    %>
    <tr>
    <td bgcolor="#FFFFFF" align="center" height="26" width="22" style="border-bottom:1px solid #C0C0C0; border-right-style: none; border-right-width: medium; border-left-style:none; border-left-width:medium; border-top-style:none; border-top-width:medium">
    <a href="viewnews.asp?ID=<%=oRs("ID")%>">
    [img]images/read.gif[/img]</a></td>
    <td bgcolor="#FFFFFF" align="center" height="26" width="22" style="border-bottom:1px solid #C0C0C0; border-right-style: none; border-right-width: medium; border-left-style:none; border-left-width:medium; border-top-style:none; border-top-width:medium">
    <a href="modificaform.asp?ID=<%=oRs("ID")%>">
    [img]images/edit.gif[/img]</a></td>
    <td bgcolor="#FFFFFF" align="center" height="26" width="22" style="border-bottom:1px solid #C0C0C0; border-left-style: none; border-left-width: medium; border-right-style:none; border-right-width:medium; border-top-style:none; border-top-width:medium">
    [img]images/delete.gif[/img]');" alt="Cancella"></a></td>
    <td bgcolor="#FFFFFF" align="center" height="26" width="22" style="border-bottom:1px solid #C0C0C0; border-left-style: none; border-left-width: medium; border-right-style:none; border-right-width:medium; border-top-style:none; border-top-width:medium">
    &statocondizione=0"><% if oRs("Condizione") = True Then %>[img]images/abilitato.gif[/img]
    <% Else %>
    <a href="condizionearchivio.asp?id=<%=oRs("ID")%>&sta tocondizione=1">
    [img]images/disabilitato.gif[/img]</a><% End IF %>
    </td>
    <td bgcolor="#FFFFFF" align="center" height="26" style="border-left-style: none; border-left-width: medium; border-right-style: none; border-right-width: medium; border-top-style: none; border-top-width: medium; border-bottom-style: solid; border-bottom-width: 1px">
    <font face="Arial" style="font-size: 8pt">
    "><%=oRS("titolo")%></font></td>
    <td bgcolor="#FFFFFF" align="center" height="26" style="border-left-style: none; border-left-width: medium; border-right-style: none; border-right-width: medium; border-top-style: none; border-top-width: medium; border-bottom: 1px solid #C0C0C0">
    <font face="Arial" style="font-size: 8pt">
    <%

    cat = oRs("id_categoria")
    Sql = "Select * From categorie "
    Set oRS2= oConn.Execute(Sql)
    While Not oRs2.EOF
    If cat = oRs2("ID") Then
    Response.Write "" & oRs2("tipo_cat") & "" & vbCRLF
    End If
    oRS2.MoveNext
    Wend
    oRS2.Close
    Set oRS2 = Nothing
    %>
    </font></td>
    <td bgcolor="#FFFFFF" align="center" height="26" width="35" style="border-left-style: none; border-left-width: medium; border-right-style: none; border-right-width: medium; border-top-style: none; border-top-width: medium; border-bottom: 1px solid #C0C0C0">
    <font face="Arial" style="font-size: 8pt"><%

    If oRS("img") = "" Then

    Response.Write "No" & vbCRLF

    Else

    Response.Write "Si" & vbCRLF

    End If

    %> </font></td>
    <td bgcolor="#FFFFFF" align="center" height="26" width="114" style="border-left-style: none; border-left-width: medium; border-right-style: none; border-right-width: medium; border-top-style: none; border-top-width: medium; border-bottom: 1px solid #C0C0C0">
    <font face="Arial" style="font-size: 8pt"><%=oRS("Data")%></font></td>
    </tr>
    <%
    iRecordsShown = iRecordsShown + 1
    x = x + 1
    oRS.MoveNext
    Loop
    %></table>
    </font>
    <div align="center">
    <table width="560" cellspacing="0" cellpadding="0" style="border-left: 0px solid #C0C0C0; border-right: 0px solid #C0C0C0; border-bottom: 0px solid #C0C0C0; ; border-top-color:#C0C0C0; border-top-width:0px" bgcolor="#FFFFFF">
    <tr>
    <td style="border-style:none; border-width:medium; " valign="middle">
    <p align="center"><a href="inserisciform.asp">
    [img]images/add.gif[/img]</a></p>
    </td>
    </td>
    </tr>
    </table></div>
    <div align="center">
    <table width="560" height="16" cellspacing="0" cellpadding="0" style="border:0px solid #C0C0C0; " bgcolor="#FFFFFF">
    <tr>
    <td bgcolor="#800000" height="15" style="border-style: none; border-width: medium">
    <p align="left">
    <font face="Arial" style="font-size: 12px" color="#FFFFFF">Pagine:
    </font><%

    For I = 1 To iPages


    Response.Write "<a href=archivionews.asp?page=" & I & "><font face=""Arial"" style=""font-size: 12px"" color=""#FFFFFF""> " & I & "</font> </a> " & vbCRLF



    Next

    Set oRS = Nothing
    oConn.Close
    Set oConn = Nothing

    %> </p></td>
    </tr>
    </table>
    <%
    else
    %>
    <div align="center">
    <table border="0" cellpadding="0" style="border-collapse: collapse" width="560">
    <tr>
    <td>
    <p align="center">
    <font face="Arial" color="#800000" style="font-size: 9pt">
    Nessuna news trovata!
    <a href="inserisciform.asp">
    [img]images/add.gif[/img]</a>
    </tr>
    </tr>
    </td>
    </tr>
    </table></div>
    <%
    end if
    %>
    </font></div></center></div>


    </div>
    </u></font></form>
    </p>

  5. #5
    Moderatore di Annunci siti web, Offro lavoro/collaborazione, Cerco lavoro L'avatar di cavicchiandrea
    Registrato dal
    Aug 2001
    Messaggi
    26,133
    Decifrare questa pagina ci voglio 3 buchi nel naso

    Il problema credo stia qi
    Response.Write "<a href=archivionews.asp?page=" & I & "><font face=""Arial"" style=""font-size: 12px"" color=""#FFFFFF""> " & I & "</font> </a> " & vbCRLF
    prova ad inserire il request("tipo_cat")?
    codice:
    Response.Write "<a href=archivionews.asp?"&Tua_request&"page=" & I & "><font face=""Arial"" style=""font-size: 12px"" color=""#FFFFFF""> " & I & "</font> </a> " & vbCRLF
    abbia pazienza ma la pagina e veramente complessa.

    Ciao
    Cavicchi Andrea
    Problemi con javascript, jquery, ajax clicca qui

  6. #6
    Utente di HTML.it
    Registrato dal
    Sep 2003
    Messaggi
    46
    grazie andrea.. ho fatto come hai detto ma il problema sussiste!!

  7. #7
    Utente di HTML.it
    Registrato dal
    Sep 2003
    Messaggi
    46

  8. #8
    Utente di HTML.it
    Registrato dal
    Sep 2003
    Messaggi
    46
    ho risolto il problema.. grazie lo stesso

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.