Visualizzazione dei risultati da 1 a 3 su 3

Discussione: Sistema banner

  1. #1

    Sistema banner

    Vorrei fare in asp un sistema con db che mi visualizzi una pagina con i banner e categorie vedi esempio


    banner (titolo)

    categoria1 categoria2 categoria3 tutti (menu che visualizza le categorie)

    banner banner banner
    banner banner banner
    banner banner banner
    banner banner banner

    (immagini banner che si vedono e cliccando aprono una pagina del loro link)

    pagina seguente e pagina precedente



    chi mi da delle dritte per inizziare

  2. #2

    vi posto la pagina che ho fatto fin orra

    <%
    Response.AddHeader "pragma","no-cache"
    Response.AddHeader "cache-control", "private"
    Response.CacheControl="no-cache"
    %>


    <html>
    <head>
    <title>Documento senza titolo</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <style type="text/css">
    <!--
    body {
    background-color: #000000;
    }
    .Stile1 {color: #FFFFFF}
    .Stile2 {
    font-family: Arial, Helvetica, sans-serif;
    font-weight: bold;
    }
    .Stile3 {color: #FFFFFF; font-family: Arial, Helvetica, sans-serif; }
    .Stile5 {color: #0000FF}
    .Stile6 {color: #FF0000}
    -->
    </style></head>

    <%
    iPageSize=21 <!--visualizza numero record pagina--

    'connessione mdb
    Set Conn = Server.CreateObject("ADODB.Connection")
    path="Provider=Microsoft.Jet.OLEDB.4.0;Data Source="&server.mappath("\db\nm.mdb")&";User Id=admin;Password=;"
    conn.connectionstring= path
    conn.Open

    Set rs = Server.CreateObject("ADODB.Recordset")
    qry="select BANNER,ID from banner order by BANNER"
    rs.CursorLocation = 3

    'apertura reordset gestione pagine

    rs.Open qry, conn, adOpenKeyset, adOpenStatic

    if request.queryString("page") = "" then
    iPageCurrent = 1
    else
    iPageCurrent = CInt(Request.querystring("page"))
    end if

    rs.PageSize= iPageSize
    rs.CacheSize= iPageSize
    iPageCount=rs.PageCount

    if iPageCurrent > iPageCount then
    iPageCurrent = iPageCount
    end if
    if iPageCurrent < 1 then
    iPageCurrent = 1
    end if
    if iPageCount > 0 then
    RS.AbsolutePage = iPageCurrent
    end if
    iRecordsShown=0
    %>


    <body>
    <div align="center">
    <table width="510" height="100" border="1" bordercolor="#666666">
    <tr>
    <td><div align="center">


    <span class="Stile5">

    LOGO</span>

    </p>
    </div></td>
    </tr>
    </table>
    <table width="510" border="1" bordercolor="#333333">
    <tr bordercolor="#333333">
    <td height="21"><div align="center" class="Stile1 Stile2">BAND</div></td>
    <td><div align="center" class="Stile3">PARTNER</div></td>
    <td><div align="center" class="Stile3">CONTATTI</div></td>
    <td><div align="center" class="Stile3">INFORMAZIONI</div></td>
    </tr>
    </table>
    <table width="510" border="1" bordercolor="#333333">
    <tr bordercolor="#333333">
    <%
    do while (irecordsShown < iPageSize) and not rs.eof
    %>
    <td width="170" height="40"><div align="center"><span class="Stile6">bannner</span></div></td>
    <td width="170" height="40"><div align="center"><span class="Stile6">bannner</span></div></td>
    <td width="170" height="40"><div align="center"><span class="Stile6">bannner</span></div></td>
    </tr>
    <%
    iRecordsShown=iRecordsShown+1
    rs.movenext
    loop
    %>

    </table>


    <table width="510" border="1" bordercolor="#333333">
    <tr>
    <td><div align="center"><% Ipgn = iPageCurrent
    Fpgn = 10
    if iPageCurrent > 5 then
    Ipgn = iPageCurrent - 5
    Fpgn = 10+Ipgn
    if (iPageCurrent >= iPageCount-5) and (iPageCurrent <= iPageCount) then
    Ipgn = iPageCount - 9
    Fpgn = iPageCount
    end if
    else
    Ipgn = 1
    end if
    if Ipgn <=0 then
    Ipgn = 1
    end if
    if Fpgn > iPageCount then
    Fpgn = iPageCount
    end if
    for p= Ipgn To Fpgn
    if p = iPageCurrent then%>
    <span class="Stile2"><%=p%></span>
    <%else%>
    <%=p%>
    <% end if
    next 'I
    %> </div></td>
    </tr>
    </table>
    </div>
    </body>
    </html>

  3. #3

    nessun aiuto

    nessun mi da iuato

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.