<br>
<%
rst.MoveNext
loop
end if
rst.close
%>
</form>
"假如返回的NAME为DEL则提示用户点击了删除连接,那么将对数据库指定记录集进行删除操作
<%
if request("name")="del" then
rst.open "delete * from type where typeid="+request("typeid"),conn,1
rst.close
end if
%>
"假如返回的NAME为EDIT则提示用户点击了修改按钮,这时候会利用返回的栏目ID(TYPEID)显示相关栏目的操作信息,并可在里面填写你想要修改的栏目名称
<%if request("name")="edit" then
rst.open "select * from type where typeid="+request("typeid"),conn,1
%>
<form name=ctype method="post" action="changepass.asp">
<INPUT TYPE="hidden" name=method value="modified">
<INPUT TYPE="hidden" name=typeid value="<%=request("typeid")%>">
<INPUT TYPE="text" size=10 NAME="typename" value="<%=rst("type")%>">
<INPUT name="changetype" class=buttonface value="修改" type='submit'>
</form>
<%
end if
rst.close
"当显示了相关栏目信息后,利用已经在修改的from里面定义的method和changetype判定用户是否点击了修改按钮,并利用UPDATA对数据库进行更新
if request("method")="modified" then
if request("changetype")="修改" then
rst.open "select * from type where typeid="+request("typeid"),conn,1,3
rst("type")=request("typename")
rst.Update
end if
end if
rst.close
%>
</td>
<td width="50%" valign="top"><br><p align=center><font color=red>增加栏目</font><br>
"在输入栏内输入想要新增的栏目名称
<form name=add method="post" action="changepass.asp">
<INPUT TYPE="hidden" name=method value="added">
<INPUT TYPE="text" size=10 NAME="addtype">