vi allego il codice completo:
Codice PHP:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
Dim Recordset2__MMColParam
Recordset2__MMColParam = "1"
If (Request.QueryString("ID_cat") <> "") Then
Recordset2__MMColParam = Request.QueryString("ID_cat")
End If
%>
<%
Dim Recordset2
Dim Recordset2_cmd
Dim Recordset2_numRows
Set Recordset2_cmd = Server.CreateObject ("ADODB.Command")
Recordset2_cmd.ActiveConnection = MM_conn_nencio_STRING
Recordset2_cmd.CommandText = "SELECT * FROM tbl_films WHERE ID = ?"
Recordset2_cmd.Prepared = true
Recordset2_cmd.Parameters.Append Recordset2_cmd.CreateParameter("param1", 5, 1, -1, Recordset2__MMColParam) ' adDouble
Set Recordset2 = Recordset2_cmd.Execute
Recordset2_numRows = 0
%>
<%
Dim rs_video__MMColParam
rs_video__MMColParam = "1"
If (Request.QueryString("ID") <> "") Then
rs_video__MMColParam = Request.QueryString("ID")
End If
%>
<%
Dim rs_video
Dim rs_video_cmd
Dim rs_video_numRows
Set rs_video_cmd = Server.CreateObject ("ADODB.Command")
rs_video_cmd.ActiveConnection = MM_conn_STRING
rs_video_cmd.CommandText = "SELECT * FROM tbl_video WHERE ID = ?"
rs_video_cmd.Prepared = true
rs_video_cmd.Parameters.Append rs_video_cmd.CreateParameter("param1", 5, 1, -1, rs_video__MMColParam) ' adDouble
Set rs_video = rs_video_cmd.Execute
rs_video_numRows = 0
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Francesco Nencini | gestione sito</title>
<link href="stile_gestione.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width="980" border="0" cellspacing="0" cellpadding="0">
<tr>
<td colspan="2"><table width="100%" border="0" cellspacing="4" cellpadding="4">
<tr>
<td class="titolo"></td>
</tr>
</table></td>
</tr>
<tr>
<td width="120" valign="top"></td>
<td width="887" valign="top"><div align="center" style="height:24px; padding-top:10px ">
</div>
<table width="100%" border="0" cellpadding="4" cellspacing="4">
<form id="form1" name="form1" method="post" enctype="multipart/form-data" ACTION="?Upload=1"> <tr>
<td width="100" valign="top" class="bordo">[b]Categoria[/b]</td>
<td width="629" valign="top" class="bordo"><select name="id_films" id="id_films">
<%
While (NOT Recordset2.EOF)
%>
<option value="<%=(Recordset2.Fields.Item("ID").Value)%>" <%If (Not isNull((Recordset2.Fields.Item("ID").Value))) Then If (CStr(Recordset2.Fields.Item("ID").Value) = CStr((Recordset2.Fields.Item("ID").Value))) Then Response.Write("selected=""selected""") : Response.Write("")%> ><%=(Recordset2.Fields.Item("titolo").Value)%></option>
<%
Recordset2.MoveNext()
Wend
If (Recordset2.CursorType > 0) Then
Recordset2.MoveFirst
Else
Recordset2.Requery
End If
%>
</select>
</td>
</tr>
<tr>
<td width="100" valign="middle" class="bordo">[b]Thumbnail[/b]</td>
<td valign="middle" class="bordo"><label><span class="bordo1">
<input name="thumb" type="file" id="thumb" value="<%=(rs_video.Fields.Item("thumb").Value)%>">
</span></label></td>
</tr>
<tr>
<td width="100" valign="top" class="bordo">[b]Cliente[/b]</td>
<td valign="top" class="bordo">
<label>
<input name="cliente" type="text" id="cliente" style="width:250px" value="<%=(rs_video.Fields.Item("cliente").Value)%>">
</label>
</p></td>
</tr>
<tr>
<td valign="top" class="bordo">[b]Titolo[/b]</td>
<td valign="top" class="bordo"><label>
<input name="titolo" type="text" id="titolo" style="width:250px" value="<%=(rs_video.Fields.Item("titolo").Value)%>">
</label></td>
</tr>
<tr>
<td valign="top" class="bordo">[b]Video[/b]</td>
<td valign="top" class="bordo"><span class="bordo1">
<input name="video" type="file" id="video" value="<%=(rs_video.Fields.Item("video").Value)%>">
</span></td>
</tr>
<tr>
<td valign="top" class="bordo">[b]On air[/b]</td>
<td valign="middle" class="bordo"><label>
<input <%If (CStr(Abs((rs_video.Fields.Item("onair").Value))) = CStr("1")) Then Response.Write("checked=""checked""") : Response.Write("")%> type="radio" name="onair" id="onair" value="1" >
sì
<input <%If (CStr(Abs((rs_video.Fields.Item("onair").Value))) = CStr("0")) Then Response.Write("checked=""checked""") : Response.Write("")%> name="onair" type="radio" id="onair" value="0">
no
</label></td>
</tr>
<tr>
<td valign="top" class="bordo">[b]In evidence[/b]</td>
<td valign="top" class="bordo"><input <%If (CStr(Abs(rs_video.Fields.Item("in evidence").Value)) = CStr("1")) Then Response.Write("checked=""checked""") : Response.Write("")%> type="radio" name="in evidence" id="in evidence" value="1">
sì
<input <%If (CStr(Abs(rs_video.Fields.Item("in evidence").Value)) = CStr("0")) Then Response.Write("checked=""checked""") : Response.Write("")%> name="in evidence" type="radio" id="in evidence" value="0">
no </td>
</tr>
<tr>
<td valign="top" class="bordo"></td>
<td valign="top" class="bordo"><label><span class="bordo1">
<input type="submit" name="button" id="button" value="Modifica video">
</span></label></td>
</tr>
</form>
</table>
<%
If Request("Upload")="1" then
Dim oUpload
Set oUpload= new cUpload
With oUpload
'La riga seguente imposta la connessione al database e la tabella di inserimento dati
'La connesione e la tabella verranno aperti con il metodo oUpload.Database.Open()
.SetDatabase "Driver={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("/mdb-database/db") ,"SELECT * FROM tbl_video"
.EnabledAspUpload = False
.EnabledImageSize = False
.EnabledLog = False
.AutoRename = False
.Overwrite = True
.SetPath "/public/"
.Load
While Not .EOF
Select Case lCase(oUpload.Files("InputName"))
Case "thumb"
fotogrande = oUpload.GetFileName()
Case "video"
fotopiccola = oUpload.GetFileName()
End Select
.Save
.MoveNext
Wend
response.Write "Il video " & fotopiccola &" è stato modificato
Torna a [url='home.asp']Films[/url]"
.Database.Open()
'Inserimento dei valori
.Database.Fields("thumb") = "/public/" & fotogrande
'.Database.Fields("percopertina") = fotogrande2
.Database.Fields("video") = "/public/" & fotopiccola
.Database.Fields("cliente") = .Form("cliente")
.Database.Fields("titolo") = .Form("titolo")
.Database.Fields("onair") = .Form("onair")
.Database.Fields("in evidence") = .Form("in evidence")
.Database.Fields("id_films") = .Form("id_films")
'Inserimento
.Database.Update()
End With
Set oUpload = Nothing
end if
%>
</td>
</tr>
</table>
</body>
</html>
<%
Recordset2.Close()
Set Recordset2 = Nothing
%>
<%
rs_video.Close()
Set rs_video = Nothing
%>