Visualizzazione dei risultati da 1 a 6 su 6
  1. #1
    Utente di HTML.it L'avatar di Lino80
    Registrato dal
    Oct 2005
    Messaggi
    1,560

    immagine al posto del testo, script creamweb by roby

    al posto di giocatore, nella cella vorrei richiamare un immagine dal db:

    codice:
    <%
    								'SI VISUALIZZA IL CONTENUTO DELLA STRINGA SQL
    								'ALL'INTERNO DELLA TABELLA PRIMA DEFINITA
    								cont=1
    								Do While iRecordsShown < iPageSize And Not objRS.EOF
    									Dim Rig, bg
    									Rig = Rig + 1
    									If Rig Mod 2 = 0 then
    										bg = "#E4E4E4"
    									Else
    										bg = "#ccccff"	
    									End if	
    									Response.Write "<tr bgcolor = " & bg & "><td><font color='#000000' face='Verdana' size='1'>" & (iPageSize*iPageCurrent)-iPageSize+Cont & "</font></td>"
    									Response.Write "<td><font color='#000000' face='Verdana' size='1'>" & objRS("giocatore") & "</font></td>"
    									Response.Write "<td align='center'><font color='#000000' face='Verdana' size='1'>" & objRS("ruolo") & "</font></td>"
    									Response.Write "<td align='center'><font color='#000000' face='Verdana' size='1'>" & objRS("sq") & "</font></td>"
    									Cont = Cont + 1
    									'POSIZIONAMENTO ALLA RIGA SUCCESSIVA DEL DB
    									iRecordsShown = iRecordsShown + 1
    									objRS.MoveNext
    								Loop
    								'PULIZIA DEGLI OGGETTI ADO
    								objRS.Close
    								Set objRS = Nothing
    								%>

    come inserisco un codite tipo questo:

    codice:
    <img src="../
    <%
    					If RS("PFoto") <> ("public/imgprodotti/") Then
    						Response.Write RS("PFoto")
    					Else
    						Response.Write  Img_NonDisponibile_P
    					End If
    %>
    					" alt="<%=Prodotto%>" width="<%=PFoto_Larghezza%>" height="<%=PFoto_Altezza%>" border="0">
    grazie

  2. #2
    Utente di HTML.it L'avatar di Lino80
    Registrato dal
    Oct 2005
    Messaggi
    1,560
    posto tutto il codice se dovesse servire:

    codice:
    <html>
    <head>
    	<title>Creamweb.it - Paginazione</title>
    </head>
    <BODY MARGINWIDTH="0" MARGINHEIGHT="0" TOPMARGIN="0" LEFTMARGIN="0" bgcolor="white">
    <TABLE WIDTH="500" CELLPADDING="0" CELLSPACING="0" BORDER="0" align="center">
    	<TR height="60" valign="middle">
    		<TD align="center">
    			<font face="verdana" size="3" color="red">Paginazione dei risultati di una query</font>
    		</TD>
    	<TR>
    		<TD>	
    			<%
    			iPageSize = 40 'NUMERO RECORD PER PAGINA
    
    			If Request.QueryString("page") = "" Then
    				iPageCurrent = 1
    			Else
    				iPageCurrent = CInt(Request.QueryString("page"))
    			End If
    
    			strSQL = "SELECT * FROM tGiocatori ORDER BY giocatore ASC"
    			Set objRS = Server.CreateObject("ADODB.Recordset")
    			objRS.PageSize = iPageSize
    			objRS.CacheSize = iPageSize
    			objRS.Open strSQL, objConn, adOpenStatic, adLockReadOnly, adCmdText
    
    			reccount = objRS.recordcount
    			iPageCount = objRS.PageCount
    
    			If iPageCurrent > iPageCount Then iPageCurrent = iPageCount
    			If iPageCurrent < 1 Then iPageCurrent = 1
    
    			If iPageCount = 0 Then
    				Response.Write "
    
    <table><td><font face='verdana' size='2' color='#000000'>Non sono stati trovati giocatori.</td></table></p>"
    			Else
    				objRS.AbsolutePage = iPageCurrent
    				iRecordsShown = 0
    				%>
    				<table cellpadding="0" cellspacing="0" border="0" width="95%">
    					<tr>
    						<td bgcolor="#cccccc">
    							<table cellpadding="2" cellspacing="1" border="0" width="100%">
    								<tr height="22">
    									<td bgcolor="#dddddd" WIDTH="6%"><font face="verdana" size="2" color="#000000">N.</font></td>
    									<td bgcolor="#dddddd" WIDTH="29%"><font face="verdana" size="2" color="#000000">Giocatore</font></td>
    									<td bgcolor="#dddddd" WIDTH="4%" align="center"><font face="verdana" size="2" color="#000000">Ruolo</font></td>
    									<td bgcolor="#dddddd" WIDTH="11%" align="center"><font face="verdana" size="2" color="#000000">Squadra</font></td>
    								</tr>
    								<%
    								'SI VISUALIZZA IL CONTENUTO DELLA STRINGA SQL
    								'ALL'INTERNO DELLA TABELLA PRIMA DEFINITA
    								cont=1
    								Do While iRecordsShown < iPageSize And Not objRS.EOF
    									Dim Rig, bg
    									Rig = Rig + 1
    									If Rig Mod 2 = 0 then
    										bg = "#E4E4E4"
    									Else
    										bg = "#ccccff"	
    									End if	
    									Response.Write "<tr bgcolor = " & bg & "><td><font color='#000000' face='Verdana' size='1'>" & (iPageSize*iPageCurrent)-iPageSize+Cont & "</font></td>"
    									Response.Write "<td><font color='#000000' face='Verdana' size='1'>" & objRS("giocatore") & "</font></td>"
    									Response.Write "<td align='center'><font color='#000000' face='Verdana' size='1'>" & objRS("ruolo") & "</font></td>"
    									Response.Write "<td align='center'><font color='#000000' face='Verdana' size='1'>" & objRS("sq") & "</font></td>"
    									Cont = Cont + 1
    									'POSIZIONAMENTO ALLA RIGA SUCCESSIVA DEL DB
    									iRecordsShown = iRecordsShown + 1
    									objRS.MoveNext
    								Loop
    								'PULIZIA DEGLI OGGETTI ADO
    								objRS.Close
    								Set objRS = Nothing
    								%>
    							</table>
    						</td>
    					</tr>
    				</table>
    			<%End if%>
    			
    
    
    			<%If ipagecount <> 1 Then%>
    				<center>
    				<table>
    					<tr valign="middle">
    						<td width="50%" align="center" valign="middle"><font face="verdana" size="1" color="#000000">
    							[
    							<%if iPageCurrent-2 > 0 and iPageCurrent > 2 then%>
    								[img]images/first.gif[/img]
    							<%end if%>
    							<%if iPageCurrent > 1 then%>
    								[img]images/pre.gif[/img]
    							<%end if%>
    							<%if iPageCount > 2 then
    								if iPageCurrent-2 < 1 then da_pag = 1 else da_pag = iPageCurrent-2
    								if iPageCurrent+2 > iPageCount then fino_a_pag = iPageCount else fino_a_pag = iPageCurrent+2
    							else
    								da_pag = 1
    								fino_a_pag = iPageCount
    							end if%>
    							<%for i = da_pag to fino_a_pag%>
    								<%if i = iPageCurrent then%>
    									<font color="red"><%=i%></font>
    								<%else%>	
    									<%=i%>
    								<%end if%>	
    							<%next%>
    							<%if iPageCurrent > 0 and iPageCurrent < iPageCount then%>
    								[img]images/next.gif[/img]
    							<%end if%>	
    							<%if iPageCurrent+1 < iPageCount then%>
    								[img]images/last.gif[/img]
    							<%end if%>	
    							]
    						</font></td>
    					</tr>
    					<tr>
    						<td colspan="2" align="center"><font face="verdana" size="1" color="#000000">
    							<center>
    							Pagina
    								<font color="#FF0000"><%=iPageCurrent%></font>
    								di
    								<font color="#FF0000"><%=iPageCount%></font>
    							</center>
    						</font></td>
    					</tr>
    				</table>
    				</center>
    			<%end if%>
    			<%
    			objConn.Close
    			Set objConn = Nothing
    			%>
    		</TD>
    	</TR>
    </TABLE>		
    </body>
    </html>

  3. #3
    Utente di HTML.it L'avatar di Lino80
    Registrato dal
    Oct 2005
    Messaggi
    1,560
    up

  4. #4
    Utente di HTML.it L'avatar di fazius
    Registrato dal
    Mar 2006
    residenza
    Torino
    Messaggi
    870
    Ciao, io ho risolto il problema semplicemente cosi:

    Response.Write "<td><font color='#000000' face='Verdana' size='1'>" & objRS("foto") & "</font></td>"
    sostituendo "calciatore" poi quando carico l'istruzione sul database
    [img]/public/userimages/golf.jpg[/img]
    lui prende la foto magari non è il sistema piu giusto pero funziona
    puoi provare mentre aspetti una risposta piu professionale
    lunga vita e prosperità

  5. #5
    Utente di HTML.it L'avatar di Lino80
    Registrato dal
    Oct 2005
    Messaggi
    1,560
    ciao, ho fatto come hai detto, ma mi da questo errore

    Microsoft OLE DB Provider for ODBC Drivers error '80040e10'

    [Microsoft][ODBC Microsoft Access Driver] Too few parameters. Expected 1.

    /pg/default.asp, line 31

  6. #6
    Utente di HTML.it L'avatar di fazius
    Registrato dal
    Mar 2006
    residenza
    Torino
    Messaggi
    870
    ciao purtroppo non sono cosi esperto ti posto il quello che uso io che funziona devi modificare i richiami ai campi se ci sono riusciuto io devi farcela
    <%@ Language=VBScript %>
    <% response.buffer=true %>
    <% Server.ScriptTimeout = 300 %>



    <html>
    <head>
    <title>I concerti </title>

    </head>
    <BODY MARGINWIDTH="0" MARGINHEIGHT="0" TOPMARGIN="0" LEFTMARGIN="0" background="sf.jpg" align="middle">
    <TABLE WIDTH="798" BORDER="0" align="center" CELLPADDING="0" CELLSPACING="0" >
    <TR height="60" valign="middle">

    <TR>
    <TD>
    <%
    iPageSize = 9 'NUMERO RECORD PER PAGINA

    If Request.QueryString("page") = "" Then
    iPageCurrent = 1
    Else
    iPageCurrent = CInt(Request.QueryString("page"))
    End If

    strSQL = "SELECT * FROM musica ORDER BY data ASC"
    Set objRS = Server.CreateObject("ADODB.Recordset")
    objRS.PageSize = iPageSize
    objRS.CacheSize = iPageSize
    objRS.Open strSQL, objConn, adOpenStatic, adLockReadOnly, adCmdText

    reccount = objRS.recordcount
    iPageCount = objRS.PageCount

    If iPageCurrent > iPageCount Then iPageCurrent = iPageCount
    If iPageCurrent < 1 Then iPageCurrent = 1

    If iPageCount = 0 Then
    Response.Write "

    <table><td><font face='verdana' size='2' color='#000000'>Non sono stati trovati artisti.</td></table></p>"
    Else
    objRS.AbsolutePage = iPageCurrent
    iRecordsShown = 0
    %>
    <table cellpadding="0" cellspacing="0" border="0" width="100%">
    <tr>

    <table cellpadding="2" cellspacing="1" border="0" width="100%">
    <tr height="50">
    <td WIDTH="1%"><font face="verdana" size="2" color="#ffffff"></font></td>
    <td WIDTH="10%" align="left"><font face="verdana" size="2" color="#000000"></font></td>
    <td WIDTH="20%" align="left"><font face="verdana" size="2" color="#000000">Artista</font></td>
    <td WIDTH="20%" align="left"><font face="verdana" size="2" color="#000000">Città</font></td>
    <td WIDTH="34%" align="left"><font face="verdana" size="2" color="#ffffff">Festival - Luogo</font></td>
    <td WIDTH="15%" align="left"><font face="verdana" size="2" color="#ffffff">Data</font></td>
    </tr>
    <%
    'SI VISUALIZZA IL CONTENUTO DELLA STRINGA SQL
    'ALL'INTERNO DELLA TABELLA PRIMA DEFINITA
    cont=1
    Do While iRecordsShown < iPageSize And Not objRS.EOF
    Dim Rig, bg
    Rig = Rig + 1
    If Rig Mod 2 = 0 then
    bg = "#ffffff"
    Else
    bg = "#ffffff"
    End if
    Response.Write "<tr><td><font color='#ffffff' face='Verdana' size='1'>" & (iPageSize*iPageCurrent)-iPageSize+Cont & "</font></td>"
    Response.Write "<td align='left'><font color='#000000' face='Verdana' size='1'>" & objRS("foto") & "</font></td>"
    Response.Write "<td align='left'><font color='#000000' face='Verdana' size='1'>" & objRS("artista") & "</font></td>"
    Response.Write "<td align='left'><font color='#000000' face='Verdana' size='1'>" & objRS("citta") & "</font></td>"
    Response.Write "<td align='left'><font color='#ffffff' face='Verdana' size='1'>" & objRS("festival") & "</font></td>"
    Response.Write "<td align='left'><font color='#ffffff' face='Verdana' size='1'>" & objRS("data") & "</font></td>"
    Cont = Cont + 1
    'POSIZIONAMENTO ALLA RIGA SUCCESSIVA DEL DB
    iRecordsShown = iRecordsShown + 1
    objRS.MoveNext
    Loop
    'PULIZIA DEGLI OGGETTI ADO
    objRS.Close
    Set objRS = Nothing
    %>
    </table>
    </td>
    </tr>
    </table>
    <%End if%>



    <%If ipagecount <> 1 Then%>
    <left>
    <table>
    <tr valign="left">
    <td width="50%" align="center" valign="left"><font face="verdana" size="1" color="#000000">
    [
    <%if iPageCurrent-2 > 0 and iPageCurrent > 2 then%>
    [img]images/first.gif[/img]
    <%end if%>
    <%if iPageCurrent > 1 then%>
    [img]images/pre.gif[/img]
    <%end if%>
    <%if iPageCount > 2 then
    if iPageCurrent-2 < 1 then da_pag = 1 else da_pag = iPageCurrent-2
    if iPageCurrent+2 > iPageCount then fino_a_pag = iPageCount else fino_a_pag = iPageCurrent+2
    else
    da_pag = 1
    fino_a_pag = iPageCount
    end if%>
    <%for i = da_pag to fino_a_pag%>
    <%if i = iPageCurrent then%>
    <font color="#000000"><%=i%></font>
    <%else%>
    <%=i%>
    <%end if%>
    <%next%>
    <%if iPageCurrent > 0 and iPageCurrent < iPageCount then%>
    [img]images/next.gif[/img]
    <%end if%>
    <%if iPageCurrent+1 < iPageCount then%>
    [img]images/last.gif[/img]
    <%end if%>
    ]

    </font></td>
    </tr>
    <tr>
    <td colspan="2" align="center"><font face="verdana" size="1" color="#000000">
    <left>
    Pagina
    <font color="#000000"><%=iPageCurrent%></font>
    di
    <font color="#000000"><%=iPageCount%></font>
    </left>
    </font></td>
    </tr>
    </table>
    </left>
    <%end if%>
    <%
    objConn.Close
    Set objConn = Nothing
    %>
    </TD>
    </TR>
    </TABLE>
    </body>
    </html>

    ovviamente devi modificare i campi a tua scelta e ovviamente devono esserci anche nel db


    ciao spero che qualcuno piu esperto ti risponda
    lunga vita e prosperità

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.