admin.asp

来自「作业提交评分管理系统」· ASP 代码 · 共 54 行

ASP
54
字号
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="check.asp" -->
<!--#include file="tcconn.asp" -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>Management System</title>
</head>
<%
select case Request.Form("action")
case "add"
	call admin_add()
case "update"
	call admin_update()
case "updatepassword"
	call admin_updatepassword()
end Select
if(Request.QueryString("action")="delete") then
call admin_delete()
end if

sub admin_add()
username=trim(Request.Form("name"))
password=trim(Request.Form("passwd"))
conn.execute("insert into [dbo_manager] ([name],[password]) values('"&username&"','"&password&"')")
response.write "<script language=JavaScript>{window.alert('添加成功!');window.location.href='admin_list.asp';}</script>"
response.end
end sub

sub admin_update()
id=trim(Request.Form("id"))
username=trim(Request.Form("name"))
password=trim(Request.Form("passwd"))
conn.execute("update  [dbo_manager] set [name]='"&username&"',[password]='"&password&"'where ([id]="&id&")")
response.write "<script language=JavaScript>{window.alert('修改成功!');window.location.href='admin_list.asp';}</script>"
response.end
end sub

sub admin_updatepassword()
id=trim(Request.Form("id"))
password=trim(Request.Form("password"))
conn.execute("update  [dbo_manager] set [password]='"&password&"'where ([id]="&id&")")
response.write "<script language=JavaScript>{window.alert('修改成功!');window.location.href='admin_edit.asp';}</script>"
response.end
end sub

sub admin_delete()
id=request("id")
conn.execute("delete  from [dbo_manager] where [id]="&id&"")
response.write "<script language=JavaScript>{window.alert('删除成功!');window.location.href='admin_list.asp';}</script>"
response.end
end sub
%>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?