After processing the program, redirect delete.asp This ASP file, to refresh the news database display, then each submitted a news material, we can immediately see the implementation of the results are successful.
The following is the contents of the delete.asp file.
% @language = "VBScript"%
《%
Response.buffer=true
Response.expires=0
%》
"The!--#include virtual="/news/data/data.inc "
《%
Set rs = Server.CreateObject ("ADODB.") Recordset ")
Sql= "SELECT * from Data order by News_class asc,news_id Desc"
' Rs. pagesize=100
Rs.Open sql,conn,3,2
%》
"HTML"
"Head"
"Meta http-equiv=" Content-type "content=" text/html; charset=gb2312 ""
Information stored in the "title" News Database "/title"
Meta name= "generator" content= "Microsoft FrontPage 3.0"
"Style type=" Text/css "
《!--
. lh22px {font-size:12px;line-height:22px;font-family: Song body}
a {Text-decoration:none}
Body {line-height:18px;font-size:9pt;font-family: XXFarEastFont-Arial}
TD {Line-height:18px;font-size:9pt;font-family: Song body}
a:hover {color: #FF0000; Text-decoration:none}
--》
"/style"
Meta name= "Microsoft Border" content= "None"
"/head"
"Body"
"Form method=" POST "action=" delete.asp "
"Table border=" 0 "width=" 750 "cellpadding=" 0 "
"TR"
TD width= "750" bgcolor= "#EBEBEB" colspan= "2" "Div align=" Center "" Center "" p "" Font
Size= "3" "strong" information stored in the news database "/strong" "/font" "/td"
"/TR"
《%
Do as not rs.eof
%》
TR align= "Center"
"TD width=" 112 "bgcolor=" #EBEBEB "is deleted:"%if rs ("News_delete") =-1 then% "
"Input type=" checkbox "Name=" "%=rs (" news_id ")%"
Value= "On"
"%else%"
"Input type=" checkbox "Name=" "%=rs (" news_id ")%"
Value= "Off"
"%end if%"
"/td"
TD width= "638" bgcolor= "#FAFAFA" align= "left" "%if rs (" News_class ") =1 then%"
"Font color=red" market situation "/font"
"%end if%"
"%if rs (" News_class ") =2 then%"
"Font color=red" it News "/font"
"%end if%"
"%if rs (" News_class ") =3 then%"
"Font color=red" Guangzhou market "/font"
"%end if%"
"%if rs (" News_class ") =4 then%"
"Font color=red" reserved "/font"
"%end if%"
"%if rs (" News_class ") =5 then%"
"Font color=red" reserved "/font"
"%end if%"
"%=rs" ("News_title")% "/td"
"/TR"
《%
Rs.movenext
Loop
%》
TR align= "Center"
TD width= "100%" colspan= "2" bgcolor= "#EBEBEB" "Center" "p" "input
Type= "Submit" value= "submitted" name= "B1" "Input type=" reset "
Value= "Clear" name= "B2" "/td"
"/TR"
"/table"
"/form"
"/body"
"/html"
《%
If Request.ServerVariables ("request_method") = "POST" Then
If not Rs.bof then
Rs.movefirst
End If
Do as not Rs.eof&nbs