delete.asp '表示下文要使用VB腳本! <%@ LANGUAGE="VBSCRIPT" %> '密碼驗證 <% if request.cookies("adminok")="" then response.redirect "login.asp" end if '讀入數(shù)據(jù)庫鏈接! <!--#include file="articleconn.asp"--> '刪除數(shù)據(jù)庫內(nèi)容的語句 <% dim sql dim rs set rs=server.createobject("adodb.recordset") sql="delete from learning where articleid="&request("ID") rs.open sql,conn,1,1 rs.close set rs=nothing conn.close set conn=nothing
response.redirect "manage.asp"
%> 大家注意的是: sql="delete from learning where articleid="&request("ID") 其中&request("id")就是同管理頁的<%=rs("articleid")%>兩者的ID數(shù)是一樣的! 關(guān)系者要刪除內(nèi)容的位置,要不然KILL錯了就麻煩了!
(出處:熱點網(wǎng)絡(luò))
|