codice:strSitePath="" strDBName="/annunci" strDBPath="/mdb-database" W_ins = Session("W_ins") W_insprg = Session("Prgannuncio") w_path = "./public/foto/" w_path_foto= w_path & W_ins & "_" & W_insprg & "/" W_path_foto_srv = Server.MapPath(W_path_foto) Set objConn=Server.CreateObject("ADODB.Connection") strConn="driver={Microsoft Access Driver (*.mdb)}; " strConn=strConn & " DBQ=" & Server.MapPath(strSitePath & strDBPath & strDBName & ".mdb") objConn.Open strConn Set objRs = Server.CreateObject("ADODB.Recordset") Set Fs = Server.createObject("Scripting.FileSystemObject") If Fs.FolderExists(W_path_foto_srv) then Set dirfoto = Fs.getfolder(W_path_foto_srv) numfoto = dirfoto.files.count indx_foto = 0 For each filefoto in dirfoto.files indx_foto = indx_foto + 1 If indx_foto = 1 Then foto_main = filefoto.name ElseIf indx_foto = 2 Then foto_main2 = filefoto.name ElseIf indx_foto = 3 Then foto_main3 = filefoto.name End if Next foto_main = w_path_foto & foto_main foto_main2 = w_path_foto & foto_main2 foto_main3 = w_path_foto & foto_main3 end if strSql="SELECT * FROM Dba_annunci WHERE Codins=" & W_ins & " And Prg=" & W_insprg objRs.Open strSql , objConn if not objRs.EOF then %> <table width="100%" border="0" align="center" bgcolor="#FF9900"> <tr> <td class="link_rev">Foto Inserite</td> </tr> </table> table width="100%" bgcolor="#FFCC00" <tr> <% If indx_foto > 0 Then %> <TD width="25%" rowspan="2" align="left"> <a href="javascript:popImage('<%= foto_main %>')"> [img]<%= foto_main %>[/img]</a> <a href="javascript: if( confirm('Sei sicuro di voler eliminare la foto?') ) { <% fs.deletefile("foto_main") %>' }">[img]./images/cancella.JPG[/img]</a> ....
In pratica questa pagina visualizza delle foto e dovrebeb dare la possibilità di cancellarle!
Questo quando esce un Confirm che chiede "sicuro di voler cancellare la foto?". E' possibile farlo funzionare?
Grazie

Rispondi quotando