Home Page
Articoli
Tips & Tricks
News
Forum
Archivio Forum
Blogs
Sondaggi
Rss
Video
Utenti
Chi Siamo
Contattaci
Username:
Password:
Login
Registrati ora!
Recupera Password
Home Page
Stanze Forum
ASP.NET 1.0/1.1
Banner a rotazione in asp
martedì 12 luglio 2005 - 23.54
Elenco Threads
Stanze Forum
Aggiungi ai Preferiti
Cerca nel forum
maverickale
Profilo
| Newbie
21
messaggi | Data Invio:
mar 12 lug 2005 - 23:54
Ciao a tutti,
Il sistema di visualizzazione dei banner a rotazione sul mio sito web da qualche tempo non visualizza più i banner e sinceramente non ne capisco il motivo vi indico alcuni dati per farvi capire. Il codice che vado ad inserire nelle varie pagine web é il seguente:
<!-- Inizio Codice Won scambio banner-->
<script type="text/javascript" language="JavaScript" src="
http://www.won.it/Banner_rotazione/select.asp?like=rotazione"></script>
<noscript>
<a href="
http://www.won.it/Banner_rotazione/view.asp?like=default"
target="_blank"><img src="
http://www.won.it/Banner_rotazione/select.asp?like=default"
border="0"></a></noscript>
<!-- Fine Codice Won scambio banner -->
mentre select.asp é costituita da tale codice:
<%
Response.Expires=0
Dim Conn
Set Conn = Server.CreateObject("ADODB.Connection")
cconn.Open "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & server.mappath("/database/banner.mdb")
come=request.querystring("like")
if come="rotazione" then
Dim rs
set rs=Server.CreateObject("adodb.recordset")
SQL="SELECT * FROM banner where utente <> 'default' and ((tothits < maxhits or maxhits=0) and (totClick < maxClick or maxclick=0)) and Datediff('d',"& Date() &", endData)>0"
rs.open SQL, Conn, 3,3
if rs.recordcount="0" then
set rs=Server.CreateObject("adodb.recordset")
SQL="SELECT * FROM banner where utente='default'"
rs.open SQL, Conn, 3,3
%>
<head>
<STYLE type=text/css>A:link {
COLOR: #6699cc
}
A:visited {
COLOR: #c4c4df
}
A:hover {
COLOR: red
}
.scritte {
FONT-WEIGHT: normal; FONT-SIZE: 8pt; COLOR: #ffffff; FONT-FAMILY: Verdana, Arial, Helvetica, sans-serif
}
</STYLE>
</head>
document.write("<a href='<% response.write(rs("url"))%>' target='<% response.write(rs("target"))%>'><img border='0' src='<% response.write(rs("immagine")) %>' alt='<% response.write (replace(rs("alt"),"'","'")) %>'></a>")
<%
rs.close
set rs=nothing
conn.close
set conn=nothing
response.end
end if
Dim totpeso
totpeso=0
do while not rs.eof
totpeso=totpeso+rs("peso")
rs.movenext
loop
Randomize()
Dim numerobanner
numerobanner=Int((totpeso*Rnd)+1)
Dim numerello
numerello=0
rs.movefirst
do while numerello+rs("peso") < numerobanner
numerello=numerello+rs("peso")
rs.movenext
loop
%>
document.write("<a href='
http://www.won.it/Banner_rotazione/view.asp?code=<%
response.write(rs("id"))%>' target='<% response.write(rs("target"))%>'><img border='0' src='<% response.write(rs("immagine")) %>' alt='<% response.write (replace(rs("alt"),"'","'"))
%>'></a>")
<%
dim newhits
newhits = rs.Fields("tothits")+ 1
rs.Fields("tothits")= newhits
rs.update
rs.close
set rs=nothing
conn.close
set conn=nothing
end if
if come="fisso" then
set rs=Server.CreateObject("adodb.recordset")
SQL="SELECT * FROM banner where fisso='si'"
rs.open SQL, Conn, 3,3
if rs.recordcount<>"0" then
%>
document.write("<a href='
http://www.won.it/Banner_rotazione/view.asp?code=<%
response.write(rs("id"))%>' target='<% response.write(rs("target"))%>'><img border='0' src='<% response.write(rs("immagine")) %>' alt='<% response.write (replace(rs("alt"),"'","'"))
%>'></a>")
<%
newhits = rs.Fields("tothits")+ 1
rs.Fields("tothits")= newhits
rs.update
end if
rs.close
set rs=nothing
conn.close
set conn=nothing
end if
if come="default" then
set rs=Server.CreateObject("adodb.recordset")
SQL="SELECT * FROM banner where utente='default'"
rs.open SQL, Conn, 3,3
Dim destinazione
destinazione=rs("immagine")
rs.close
set rs=nothing
conn.close
set conn=nothing
response.redirect destinazione
end if
%>
verificando voi stessi vi renderete conto che i banner non vengono visualizzati sulle pagine, mentre sul pannello di controllo del database access, funzionano regolarmente e visulizzano i vari banner, qualcuno se la sente di darmi una mano?
grazie in anticipo
Brainkiller
Profilo
| Guru
7.999
messaggi | Data Invio:
mer 13 lug 2005 - 23:16
Ciao,
con questa implementazione di solito io vado a guardare cosa ritorna l'URL inserita nell'attributo SRC cioè :
http://www.won.it/Banner_rotazione/select.asp?like=defaul
Infatti vedi che compare un errore. Probabilmente da qui riesci a risolvere. Sempre che sia questo quello che ti blocca.
Molto bella la presentazione in Flash del sito!
David De Giacomi
Microsoft MVP
http://blogs.dotnethell.it/david/
maverickale
Profilo
| Newbie
21
messaggi | Data Invio:
mer 27 lug 2005 - 23:16
Ciao,
Facendo clic sul link che mi indichi mi dice che non é possibile visualizzare la pagina, ma questo come può aiutarmi? Per favore non so più cosa fare per venirne a capo
A proposito grazie per i complimenti che mi fai
Brainkiller
Profilo
| Guru
7.999
messaggi | Data Invio:
gio 28 lug 2005 - 11:14
Allora, evidentemente hai configurato IE in modo errato. Aprendo quella pagina a me l'errore che compare è il seguente:
Active Server Pages error 'ASP 0126'
Include file not found
/Banner_rotazione/select.asp, line 1
The include file 'banner/config.asp' was not found.
Forse ti da una mano questo.
ciao
David De Giacomi
Microsoft MVP
http://blogs.dotnethell.it/david/
Torna su
Stanze Forum
Elenco Threads
Partecipa anche tu! Registrati!
Hai bisogno di aiuto ?
Perchè non ti registri subito?
Dopo esserti registrato potrai chiedere
aiuto sul nostro
Forum
oppure aiutare gli altri
Consulta le
Stanze
disponibili.
Registrati ora !