Visualizzazione dei risultati da 1 a 4 su 4
  1. #1
    Utente di HTML.it
    Registrato dal
    Mar 2001
    Messaggi
    163

    non mi legga request.querystring

    Il mio problema è questo:
    ho una pagina dove mi appaiono in una tabella 6 foto,cliccandoci sopra mi si apre la pagina foto.asp che mi fa vedere l'ingrandimento della foto cliccata.
    Ora fin qui tutto ok.Volendo aggiungere un pulsante precedente e successivo che mi porti al campo successivo o precedente.tenendo conto che i campi all'interno del quale devo scorrere sono foto,foto1,foto2,foto3,foto4,foto5
    VI POSTO QUESTO CODICE
    <%
    prod=Request.QueryString("id")
    campo=request.querystring("campo")
    pos=request.querystring("pos")
    %>
    <% if campo = "foto" then %>
    <%pos=1%>
    <td ></td>
    <td></td>
    <td><a href="foto.asp?id=<%=rec("id_prodotto")%>&campo=(f oto &pippo)" target="_self">
    succ</a></td>
    <%else %>
    <td><a href="foto.asp?id=<%=rec("id_prodotto")%>&campo=fo to" target="_self">
    prec</a></td>
    <td></td>
    <td><a href="foto.asp?id=<%=rec("id_prodotto")%>&campo=fo to&pos" target="_self">
    succ</a></td>
    <%end if%>
    </tr>
    </table>
    come mai non riesco a far andare i pulsanti?????
    non mi prende il valore pos
    Accetto suggerimenti volentieri per corregere lo script!!!!!

  2. #2
    scusa non ho capito molto
    se campo = foto
    fai questo link
    codice:
    href="foto.asp?id=<%=rec("id_prodotto")%>&campo=(foto &pippo)
    in questo caso cosa è foto & pippo? poi vedi qui non passi pos come valore non ti serve?
    seconda cosa quando campo sarà = foto?

    nel else finale scrivi
    codice:
    <td><a href="foto.asp?id=<%=rec("id_prodotto")%>&campo=foto" target="_self">
    prec</a></td>
    <td> </td>
    <td><a href="foto.asp?id=<%=rec("id_prodotto")%>&campo=foto&pos" target="_self">
    succ</a></td>
    ma qui pos non viene mai impostato sulla voce prec non viene scritto niente sulla voce succ scrivi pos e basta devi almeno scrivere pos=<%=pos%>.


    Comunque mi sembra che nel primo caso non passerà mai dal codice che hai scritto

  3. #3
    Utente di HTML.it
    Registrato dal
    Mar 2001
    Messaggi
    163

    reimpostato cosi

    Ho risolto cosi':
    sembra funzionare

    <table border="1" width="100%" id="table3">
    <tr>
    <% if campo = "foto" then%>
    <td ></td>
    <td></td>
    <td>&campo=foto1" target="_self">succ</td>
    <%else %>
    <% if campo="foto1" then %>
    <td>&campo=foto" target="_self">prec</td>
    <td></td>
    <td>&campo=foto2" target="_self">succ</td>
    <%end if%>
    <% if campo="foto2" then %>
    <td>&campo=foto1" target="_self">prec</td>
    <td></td>
    <td>&campo=foto3" target="_self">succ</td>
    <%end if%>
    <% if campo="foto3" then %>
    <td>&campo=foto2" target="_self">prec</td>
    <td></td>
    <td>&campo=foto4" target="_self">succ</td>
    <%end if%>
    <% if campo="foto4" then %>
    <td>&campo=foto3" target="_self">prec</td>
    <td></td>
    <td>&campo=foto5" target="_self">succ</td>
    <%end if%>
    <% if campo="foto5" then %>
    <td>&campo=foto4" target="_self">prec</td>
    <td></td>
    <td></td>
    <%end if%>
    <%end if%>

  4. #4
    funziona se però hai più foto come fai?
    io farei così
    codice:
    <%
    prod=Request.QueryString("id")
    campo=request.querystring("campo")
    pos=request.querystring("pos")
    
    if not isnumeric(pos) then pos =1
    
    if pos = 1 then
    %>
    
    <td>&campo=foto<%=pos+1%>" target="_self">succ</td>
    <%else%>
    
    <td>&campo=foto<%=pos-1%>" target="_self">prec</td>
    
    
    <td>&campo=foto<%=pos+1%>" target="_self">succ</td>
    
    
    
    <%end if%>

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 © 2026 vBulletin Solutions, Inc. All rights reserved.