salve, vorrei caricare sul server a ruba delle immagini ( lo script funziona già ) e nello stesso tempo salvare su un database access il commento alle immagini e il loro percorso, vi posto il codice della maschera :
e questo è il codice che riceve i dati della maschera :codice:<table align="center"><tr><td>[img]img/insegnarid.gif[/img]</td></tr></table> <FORM NAME="MyForm" METHOD="POST" ENCTYPE="multipart/form-data" action="caricadb_img.asp"> <table bgcolor="#2A1F55" align="center" border="2" width="50%"><tr><td> <table bgcolor="#D3A55F"align="center" border="0" width="100%"> <tr> <td width="100%" colspan="3"> <h2 align="center"><font color="#2A1FFF">CARICAMENTO FOTOGRAFIE</font></h2></td> </tr> <tr> <td width="31%"><font color="#2A1FFF">TITOLO</font></td> <td width="69%" colspan="2"><input type="text" size="35"name="titoloimg"></td> </tr> <tr> <td width="31%"><font color="#2A1FFF">DESCRIZIONE</font></td> <td width="69%" colspan="2"><TEXTAREA NAME="descimg" COLS=35 ROWS=3></TEXTAREA></td> </tr> <tr> <td width="31%"><font color="#2A1FFF">CERCA FOTOGRAFIA</font></td> <td width="69%" colspan="2"><INPUT TYPE=FILE SIZE=40 NAME="FILE1"></td> </tr> <tr> <td width="31%"></td> <td width="20%"><INPUT TYPE=SUBMIT VALUE=" CARICA "></td> <td width="49%"></td> </tr> </table> </td></tr></table> </FORM>
codice:strdesc = Trim( Lcase(request("descimg"))) if len(strdesc) = 0 then %> <META HTTP-EQUIV="Refresh" CONTENT="1; url=allerta.htm"> <% else strtit = Trim( Lcase(request("titoloimg"))) if len(strtit) = 0 then %> <META HTTP-EQUIV="Refresh" CONTENT="1; url=allerta.htm"> <% else Set Upload = Server.CreateObject("Persits.Upload.1") 'Upload.SetMaxSize 50000, True percorso=Server.MapPath("/public") On Error Resume Next Upload.Save(percorso) Set File = Upload.Files("FILE1") filename=File.FileName Set Jpeg = Server.CreateObject("Persits.Jpeg") 'indirizzo = percorso & "/" & filename indirizzo = "/public/" & filename 'creo la connessione, il recordset e la query di connessione Set Conn = Server.CreateObject("ADODB.Connection") Conn.Provider = "Microsoft.Jet.OLEDB.4.0" Conn.ConnectionString = "Data Source=" & Pathimg Conn.Open Set Rs = Server.CreateObject("ADODB.Recordset") Rs.Open "INSERT INTO eventi (titolo,descrizioneimg,percorso) VALUES ('" & strtit & "', '" & strdesc & "', '" & indirizzo & "')", Conn, 2,3 Conn.Close Set Conn=Nothing Rs.close end if end if
l'errore che mi da è che non riceve i dati di titolo e descrizione, potete aiutarmi,
saluti Roberto

Rispondi quotando