Vi posto il codice di lettura e quello di salvataggio dati.
Premetto che si è bloccato così dal momento in cui ho cercato di inserire un dato aprendo il sito con Mozilla; il sito risiede su Aruba!!
LETTURA
codice:
<%@LANGUAGE="VBSCRIPT"%>
<html>
<head>
<title>Baddy's - Guestbook</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="prenotazioni.css" rel="stylesheet" type="text/css">
<style>
body{
padding:0;
margin:0;
width:100%;
height:100%;
scrollbar-face-color: #426782;
scrollbar-shadow-color: #213341;
scrollbar-highlight-color: #426782;
scrollbar-3dlight-color: #213341;
scrollbar-darkshadow-color: #213341;
scrollbar-track-color: #426782;
scrollbar-arrow-color: #213341;
border-left:2px solid #345268;
border-right:2px solid #345268;
border-top:2px solid #345268;
border-bottom:2px solid #345268;
}
</style>
<link href="prenotazioniemail.css" rel="stylesheet" type="text/css">
</head>
<%
strprov = "DRIVER=Microsoft Access Driver (*.mdb); DBQ=" & Server.MapPath("/mdb-database/Baddy's/db.mdb")
set rs=Server.CreateObject("ADODB.Recordset")
strq = "select * from prenotazioni order BY data"
rs.Open strq, strprov,3,3
%>
<body bgcolor="#55768E" class="prenotazioni">
<%
if rs.recordcount = 0 then
response.Write("<div class=prenotazioni>NESSUN MESSAGGIO.</div>")
else
Response.Write("<table width=100% >")
rs.movefirst
while not rs.eof
Response.Write("<tr>")
Response.Write("<td bgcolor=#55768E class=prenotazioni>")
Response.Write("
")
Response.Write("NOME: " & rs("nome") & "
")
Response.Write(rs("messaggio"))
Response.Write("</td>")
Response.Write("</tr>")
Response.Write("<tr>")
Response.Write("<td heigth=2 bgcolor=#8DA3B4>")
Response.Write("</td>")
Response.Write("</tr>")
rs.movenext
wend
Response.Write("</table>")
end if
rs.close
%>
</table>
</body>
</html>
SCRITTURA
codice:
<%@LANGUAGE="VBSCRIPT"%>
<html>
<head>
<title>Baddy's - Guestbook</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language=javascript>
function AggiornaFrames(link1,link2) {
top.sopra.location.href = link1;
top.sotto.location.href = link2;
}
</script>
</head>
<body>
<%
Cnome = Trim(Request.Form("Camponome"))
if Cnome = "" then
Cnome = "Anonimo"
end if
Cmessaggio = Trim(Request.Form("Campomessaggio"))
if Cmessaggio <> "" then
Cmessaggio = replace(Cmessaggio,chr(13),"
")
end if
Cdata = date()
strq = "INSERT INTO prenotazioni (nome,messaggio,data) VALUES ('" & Cnome & "','" & Cmessaggio & "','" & Cdata & "')"
strprov = "DRIVER=Microsoft Access Driver (*.mdb); DBQ=" & Server.MapPath("/mdb-database/Baddy's/db.mdb")
set rst=Server.CreateObject("ADODB.Recordset")
rst.Open strq,strprov
%>
<script>AggiornaFrames('guestbook_leggi.asp','guestbook.html')</script>
</body>
</html>