📄 delete.asp
字号:
<%Response.Buffer=True%>
<!--#Include file="conn.asp"-->
<html>
<head>
<title>删除留言</title>
</head>
<body>
<form name="form1" method="post" action="">
<div align="center">
<table width="301" height="135" border="1">
<tr>
<td width="75" height="44">用户名:</td>
<td width="232"><input type="text" name="uname"></td>
</tr>
<tr>
<td height="42">密 码:</td>
<td><input type="password" name="upass"></td>
</tr>
<tr>
<td colspan="2"><div align="center">
<input type="submit" name="Submit" value="确 定">
</div></td>
</tr>
</table>
</div>
</form>
<div align="left">
<%
strname=Request("uname")
strpass=Request("upass")
'当输入不为空时执行
If strname<>"" and strpass<>"" Then
Set rs=server.createobject("ADODB.Recordset")
strSql="Select * From admin Where admin='"&strname&"' and password='"&strpass&"'"
rs.open strSql,conn,1,1
'检查是否是管理员身份
If rs.eof Then
response.write "<p align='center'><font size=-1><a href='index.asp'>对不起,用户名密码错误!</a></font></p>"
Else
'如果用户名密码正确,则执行删除
Dim strSql2,strtitle
'返回要删除的留言标题
strtitle=Request.QueryString("title_id")
strSql2="Delete From subtab Where title_id =" & strtitle
'删除记录
conn.Execute(strSql2)
'关闭对象
conn.Close
'重定向回首页
Response.Redirect "index.asp"
End If
End If
%>
</div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -