Pagina 1 di 4 1 2 3 ... ultimoultimo
Visualizzazione dei risultati da 1 a 10 su 31
  1. #1

    Inserimento immagine dal database

    Ciao ragazzi
    ho preso uno script per le news e lo sto trasformando per annunci con foto, solo che non mi carica la foto dal database.
    nel database, al campo foto1, c'è foto.jpg ma non vedo nulla nel browser.
    E' possibile far si che veda l'immagine ma rimpicciolita e che si apra grande col click?
    grazie


    <%

    %>
    <html>
    <head>
    <title>LISTA NEWS</title>
    <link rel="stylesheet" href="setting.css" type="text/css">
    </head>
    <body>
    <p align="center"><font face="Verdana" color="#0000FF">LISTA DELLE NEWS</font></p>
    <p align="center">
    <%
    dim cns
    set cns = server.createobject("ADODB.Connection")
    cns.open "DRIVER={Microsoft Access Driver (*.mdb)};dbq=" & Server.MapPath("/mdb-database/prova.mdb")

    dim rsnews, sqlnewws
    set rsnews = server.createobject("ADODB.RecordSet")
    sqlnewws = "SELECT * FROM news ORDER BY data2 DESC"
    rsnews.open sqlnewws, cns, 3, 3

    if rsnews.eof then
    %>


    </p>
    <p align="center"><font size="2" face="Verdana">SPIACENTE, Nessuna News per il Momento!!!</font>
    <%
    else

    do while not rsnews.eof
    %>


    <table width="600" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
    <td></td>
    <td></td>
    </tr>
    <tr>
    <td>Rilasciata il:</td>
    <td></td>
    </tr>
    <tr>
    <td><font size="2">
    <% = rsnews("data") %>
    </font></td>
    <td></td>
    </tr>
    <tr>
    <td><font face="verdana" size="2">
    <% = rsnews("titolo") %>
    </font></td>
    <td></td>
    </tr>
    <tr>
    <td><font face="verdana" size="2">
    <% = rsnews("testo") %>
    </font></td>
    <td></td>
    </tr>
    <tr>
    <td><font face="verdana" size="2"><img src="<%=foto1%>
    </font>
    </td>
    </tr>
    </table>

    </center>
    </div>

    <%
    if session("login") = "Admin" then
    %>
    <font face="verdana" size="1">
    [/i]</font></td>
    <td></td>
    </tr>
    <tr>
    <td></td>
    <td></td>
    </tr>
    <tr>
    <td>">CANCELLA ">MODIFICA </td>
    <td></td>
    </tr>
    </table>
    <tr>
    <td rowspan="3" width="28%" valign="top">

    <font size="1" face="Verdana">
    <font size="2"></font>
    </td>
    <td width="72%">
    <font face="verdana" size="2">
    </font>
    </td>
    </tr>
    <tr>
    <td style="padding-bottom: 6"><font face="verdana" size="2">
    </font></td>
    </tr>
    <tr>
    <td width="72%" style="padding-bottom: 6">

    [/b]</font>
    <%
    end if
    %><%
    rsnews.movenext
    loop

    end if
    %>
    </body>
    </html>

  2. #2
    Forse volevi scrivere:

    codice:
    [img]<%=rsnews([/img]
    Provare paura per un qualcosa che ti possa capitare nel futuro non ti evita quell'evento,ti fa soltanto vivere un presente sbagliato!

  3. #3
    grazie mille, sei stato gentilissimo!
    volevo chiederti anche se è possibile fargli fare un click alla foto per aprirla in dimensione naturali.
    ciao e mille grazie ancora

  4. #4
    ASP non c'entra in questo caso.
    Basta una funzione JS che apre un popup con la foto a dimensioni reali.
    Provare paura per un qualcosa che ti possa capitare nel futuro non ti evita quell'evento,ti fa soltanto vivere un presente sbagliato!

  5. #5
    hai ragione scusami! me ne ero dimenticata! sto andando in pallone con tutti questi codici.

    mi sapresti dire che codice inserire e dove per visualizzare una immagine standard (tipo NO FOTO) se non è presente alcuna fotografia inserente l'annuncio?

    ciao e grazie ancora!
    Mara

  6. #6
    Fai così:

    codice:
    <td><font face="verdana" size="2">
      
      <% if rsnews("foto1") <> "" and Not IsNull(rsnews("foto1")) then %>
        [img]<%=rsnews([/img]"> 
      <% else %>
        [img]no_foto.jpg[/img]     
      <% end if %>
      
    </font></td>
    Provare paura per un qualcosa che ti possa capitare nel futuro non ti evita quell'evento,ti fa soltanto vivere un presente sbagliato!

  7. #7
    scusami, ho apportato dei cambiamenti per più foto ho provato e stallava. dove lo metto se ho anche altre foto?
    dopo non ti disturbo più, promesso!



    <%

    %>
    <html>
    <head>
    <title>LISTA NEWS</title>
    <link rel="stylesheet" href="setting.css" type="text/css">
    <style type="text/css">
    <!--
    .Stile2 {font-size: 12px; font-family: Verdana, Arial, Helvetica, sans-serif;}
    .Stile3 {color: #999999}
    .Stile4 {font-size: 10px}
    .Stile5 {font-size: 10px; font-family: Verdana, Arial, Helvetica, sans-serif; }
    -->
    </style>
    </head>
    <body>
    <p align="center">
    <%
    dim cns
    set cns = server.createobject("ADODB.Connection")
    cns.open "DRIVER={Microsoft Access Driver (*.mdb)};dbq=" & Server.MapPath("/mdb-database/prova.mdb")

    dim rsnews, sqlnewws
    set rsnews = server.createobject("ADODB.RecordSet")
    sqlnewws = "SELECT * FROM news ORDER BY data2 DESC"
    rsnews.open sqlnewws, cns, 3, 3

    if rsnews.eof then
    %>



    </p>
    <p align="center"><font size="2" face="Verdana"> Nessun immobile al momento</font>
    <%
    else

    do while not rsnews.eof
    %>


    <table width="600" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
    <td width="110" height="20" valign="top" class="Stile2"><span class="Stile4">Data:</span></td>
    <td width="490" valign="top" class="Stile2"><font size="2">
    <% = rsnews("data") %>
    </font></td>
    </tr>
    <tr>
    <td height="20" valign="top"><span class="Stile4"><font face="verdana">Localit&agrave;:</font></span></td>
    <td valign="top" class="Stile2"><font face="verdana" size="2">
    <% = rsnews("titolo") %>
    </font></td>
    </tr>
    <tr>
    <td height="20" valign="top" class="Stile5">Descrizione:</td>
    <td valign="top" class="Stile2"><font face="verdana" size="2">
    <% = rsnews("testo") %>
    </font></td>
    </tr>
    <tr>
    <td colspan="2"></td>
    </tr>
    <tr>
    <td valign="top">
    <span class="Stile5"><font face="verdana">Immagini:</font></span></td>
    <td><font face="verdana" size="2">[img]<%=rsnews([/img]" border=1 width="60" height="50"> [img]<%=rsnews([/img]" border=1 width="60" height="50"> [img]<%=rsnews([/img]" border=1 width="60" height="50"> [img]<%=rsnews([/img]" border=1 width="60" height="50"> [img]<%=rsnews([/img]" border=1 width="60" height="50"> </font></td>
    </tr>
    <tr>
    <td colspan="2"><span class="Stile3">___________________________________ ________________________</span></td>
    </tr>
    </table>

    </center>
    </div>

    <%
    if session("login") = "Admin" then
    %>
    <font face="verdana" size="1">
    [/i]</font></td>
    <td></td>
    </tr>
    <tr>
    <td></td>
    <td></td>
    </tr>
    <tr>
    <td><div align="center">">CANCELLA ">MODIFICA </div></td>
    <td></td>
    </tr>
    </table>
    <tr>
    <td rowspan="3" width="28%" valign="top">

    <font size="1" face="Verdana">
    <div align="center"></div>
    <div align="center"></div>
    <div align="center">

    <font size="2"></font>
    </div></td>
    <td width="72%">
    <font face="verdana" size="2">
    </font>
    </td>
    </tr>
    <tr>
    <td style="padding-bottom: 6"><font face="verdana" size="2">
    </font></td>
    </tr>
    <tr>
    <td width="72%" style="padding-bottom: 6">

    [/b]</font>
    <%
    end if
    %><%
    rsnews.movenext
    loop

    end if
    %>
    </body>
    </html>

  8. #8
    Intendi più foto per lo stesso record? e che significa stallava? :master:
    Provare paura per un qualcosa che ti possa capitare nel futuro non ti evita quell'evento,ti fa soltanto vivere un presente sbagliato!

  9. #9
    si esatto, ci sono 5 foto per ogni annuncio, se c'è la foto la visualizza e volevo che se non ci fossero foto venisse fuori una foto standard. stallava nel senso che mi dava un errore.

  10. #10
    Questo ti dà errore?

    codice:
    <td><font face="verdana" size="2">
      
      <% if rsnews("foto1") <> "" and Not IsNull(rsnews("foto1")) then %>
        [img]<%=rsnews([/img]"> 
      <% else %>
        [img]no_foto.jpg[/img]     
      <% end if %>
      
    </font></td>
    [/QUOTE]
    Provare paura per un qualcosa che ti possa capitare nel futuro non ti evita quell'evento,ti fa soltanto vivere un presente sbagliato!

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.