📄 dropdb.asp
字号:
<%
Response.Buffer = true
%>
<!--#include file="top.asp"-->
<TABLE WIDTH=750 bgcolor=#E7F1EC cellspacing=1 cellpadding=0 border=0>
<TR>
<TD width=200 valign=top><!--#include file="left.asp"--></TD>
<TD width=550 valign=top>
<TABLE WIDTH=100% cellpadding=5 cellspacing=0>
<TR>
<TD bgcolor="#339999" align=center width=550 class=celltitle>Drop Database</TD>
</TR>
<TR>
<TD class=cellsmallcontent>
<%
if len(request("go")) = 0 then
if session("username") = "root" then
sql = "show databases"
else
sql = "select db from mysql.db where user = '" & session("username") & "'"
end if
set rsShowDB = server.createobject("ADODB.Recordset")
rsShowDB.cursorlocation = 3
rsShowDB.open sql, dsn, 2, 3
%>
<FORM ACTION=dropdb.asp?go=y method=post>
<TABLE cellpadding=2 cellspacing=1 border=0 style="border:solid black 1pt;">
<TR>
<TD bgcolor=#339999 class=cellsmalltitle align=center>Select Database to Drop</TD>
</TR>
<TR>
<TD class=cellsmallcontent>
<BR>
<FONT COLOR=RED>
<B>Caution: This cannot be undone.<BR>
You will not receive any confirmation <BR>
regarding this action.<BR><BR>
</TD>
</TR>
<TR>
<TD class=smallcellcontent>
<SELECT NAME=db size=6>
<%
for i = 1 to rsShowDB.recordcount
if session("username") = "root" then
%>
<OPTION VALUE="<%=rsShowDB("database")%>"><%=rsShowDB("database")%></OPTION>
<%
else
%>
<OPTION VALUE="<%=rsShowDB("db")%>"><%=rsShowDB("db")%></OPTION>
<%
end if
rsShowDB.movenext
next
%>
</SELECT>
</TD>
</TR>
<TR>
<TD><INPUT TYPE=SUBMIT VALUE="Drop Database"></TD>
</TR>
</TABLE>
</FORM>
<%
else
set cn = server.CreateObject("ADODB.COnnection")
cn.Open dsn
cn.Execute "drop database " & request("db")
set cn = nothing
Response.Clear
Response.Redirect "index.asp"
end if
%>
</TD>
</TR>
</TABLE>
</TD>
</TR>
</TABLE>
<!--#include file="bottom.asp"-->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -