Ciao ragazzi, ho la seguente index (nella root del sito):
<html>
<head>
<title>:: 95034.it ::</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body leftmargin="0" topmargin="0">
<table width="780" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="2" bgcolor="#99CC00"> <div align="right">
</div></td>
</tr>
<tr>
<td width="405" height="99" bgcolor="#FFFFFF"></td>
<td width="375" bgcolor="#FFFFFF"> <div align="center">
</div></td>
</tr>
<tr>
<td colspan="2"></td>
</tr>
<tr>
<td colspan="2"><div align="right">Registrazione</div></td>
</tr>
<tr>
<td colspan="2"></td>
</tr>
</table>
</body>
</html>
mentre la pagina vedi.asp (dentro la cartella banner) è la seguente:
<%
Set Conn=Server.CreateObject("ADODB.Connection")
strConn="driver={Microsoft Access Driver (*.mdb)}; "
strConn=strConn & " DBQ=" & Server.MapPath("mdb-database/generale.mdb")
strConn=strConn & ";pwd=" & strCode
Conn.Open strConn
Dim strdata, strpassata
miaData = Now
strdata = (formatDateTime(miaData, vbShortDate))
sql = "SELECT * FROM dati ORDER BY ID"
Set rs = Server.CreateObject("ADODB.Recordset")
rs.open sql, conn, 3,3
If not rs.EOF Then
strBanners = rs.getrows()
rs.movefirst
Do While Not rs.EOF
intCounter = intCounter + 1
rs.movenext
Loop
If intCounter < 2 Then
file = "../public/banner/" &strBanners(2,0)
strid = strBanners(0,0)
url = "banner/cambiourl.asp?id="&strid&"&url="&strBanners(3,0)
strDisplay = "[img] & file & [/img]"
Else
Randomize
intID = Int(Rnd * intCounter)
file = "public/banner/" &strBanners(2,intID)
strid = strBanners(0,intID)
url = "banner/cambiourl.asp?id="&strid&"&url="&strBanners(3,intI D)
strDisplay = "[img] & file & [/img]"
End If
Else
' If there are no banners in DB, display default banner
strDisplay = "[img]&strDefault&[/img]"
End If
sql = "SELECT * FROM dati WHERE id=" & strid
Set rs = Server.CreateObject("ADODB.Recordset")
rs.open sql, conn, 3,3
strpassata = rs("data_scadenza")
valore = dateDiff("d", strpassata, strdata)
If rs(5) = rs(6) or rs(9) = "no" or valore < 0 then
rs(9) = "no"
rs.update
response.redirect("vedi.asp")
else
Response.Write(strDisplay)
rs(6) = rs(6) + 1
strcrate = (rs(7)/rs(6))*100
rs(8) = strcrate
rs.update
rs.Close
set rs = Nothing
conn.Close
set conn = Nothing
end if
%>
ma non va.... Ho paura di sbagliare qualcosa con gli include!!!

Rispondi quotando