ciao a tutti, qualcuno riesce a trovare un errore in questo codice? sicuramente c'è perchè mi da una pagina di errore, la classica schermata "Impossibile visualizzare la pagina"
grazie mille
<%@LANGUAGE = VBScript%>
<%
If Session("admin") <> "OK" Then Response.Redirect "index.asp"
Dim cn, rs
Set cn = Server.CreateObject("ADODB.Connection")
Set rs = Server.CreateObject("ADODB.Recordset")
cn.Open sc
%>
<html>
<head>
<title><%=titolo%></title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body>
<h1 align="center"><%=titolo%></h1>
<form method="post" action="insert.asp">
<table align="center" width="50%" border="1">
<tr>
<td width="40%">Data</td>
<td width="60%"><input type="text" name="giorno" maxlength="50" style="width: 100%;"></td>
</tr>
<tr>
<td>Città</td>
<td><input type="text" name="citta" maxlength="10000" style="width: 100%;"></td>
</tr>
<tr>
<td>Venue</td>
<td><input type="text" name="venue" maxlength="10000" style="width: 100%;"></td>
</tr>
<tr>
<td>Guests</td>
<td><input type="text" name="guests" maxlength="10000" style="width: 100%;"></td>
</tr>
<tr>
<td colspan="2" align="right">
<input type="submit" name="insert" value=" Nuovo ">
</td>
</tr>
</table>
</form>
<%
If Request.Form("insert") = " Nuovo " Then
Dim giorno, citta, venue, guests
giorno = Request.Form("giorno")
citta = Request.Form("citta")
venue = Request.Form("venue")
guests = Request.Form("guests")
If Len(Trim(giorno)) = 0 Or Len(Trim(citta)) = 0 Or Len(Trim(venue)) = 0
Then
Response.Write "<p align=""center"">Tutti i campi sono obbligatori</p>"
Else
rs.Open "gigs", cn, 3, 3
rs.AddNew
rs("giorno") = giorno
rs("citta") = citta
rs("venue") = venue
rs("guests") = guests
rs.Update
rs.Close
Response.Write "<p align=""center"">Inserimento effettuato con successo</p>"
End If
End If
%>
<p align="center">LEGGI I DATI | LOGOUT</p>
<p align="center" style="font: Normal 10px Verdana;">
</p>
</body>
</html>
<%
Set rs = Nothing
cn.Close
Set cn = Nothing
%>

Rispondi quotando