Modificare il file:
\Offerte\admin\listproducts.asp
<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> <%if not session("AdminOk")="true" then response.Redirect "login.asp" %> <!--#Include file="cn.asp"--> <% dim rs dim cn dim msg set cn = server.CreateObject("Adodb.Connection") set rs = server.CreateObject("Adodb.Recordset") cn.Open conn if request.Form("Submit")="Cancella" then Call Del() End if Sub Del() dim num dim i dim Total_Del num = Request.Form("num") for i = 1 to num id = Request.Form("d" & i) if id<>"" then rs.Open "Delete From Products Where ProductID=" & id, cn Total_Del = Total_Del + 1 end if next msg = Total_Del & " record(s) cancellati" End Sub rs.open "Select * From Products", cn %> <html> <head> <title>Lista Lavorazioni</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link href="style.css" rel="stylesheet" type="text/css"> </head> <body> <p align="center"><font face="Georgia, Times New Roman, Times, serif">Amministrazione occasioni<br> </font><img src="../../img/Logo04-100x99.png" width="100" height="99"></p> <p> </p> <p> <% response.Write(msg) if not rs.EOF then %> </p> <form name="form1" method="post" action=""> <table width="67%" border=1 align="center" cellpadding=1 cellspacing=1 bordercolor="#CCCCCC"> <tr bgcolor="#CCCCCC"> <td width="4%"> </td> <td><strong><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Nome OCCASIONI</font></strong></td> </tr> <%while not rs.EOF n = n + 1 %> <tr> <td width="4%"> <input id=d<%=n%> type=checkbox name=d<%=n%> value="<%=rs.Fields("ProductID")%>"> </td> <td><a href="frmproduct.asp?id=<%=rs.Fields("ProductID")%>"><%=rs.Fields("ProductName")%></a></td> </tr> <% rs.MoveNext wend %> <tr> <td colspan="2"> <input type="hidden" name="num" value="<%=n%>"> <input id=submit type=submit value=Cancella name=submit> </td> </tr> </table> </form> <p> <% else Response.Write "Non ci sono articoli" end if rs.Close cn.Close %> </p> <p> </p> <p style="font-family: Verdana, Geneva, sans-serif; font-weight: bold; color: #006;">Ritorna al <a href="admin.asp">Menù</a></p> </body> </html>
[
Íàçàä
]