📄 default.asp
字号:
<%if Request("Submit")<>"" then%>
<!--#include file="config.asp"-->
<!--#include file="function.asp"-->
<%
session("admin")=false
session("user_name")=""
Set Con=Server.CreateObject("ADODB.Connection")
Con.Open constr
set objSchema = Con.OpenSchema(20,Array(Empty, Empty, Empty, "TABLE"))
Do until objSchema.EOF
if objSchema("TABLE_NAME")="sanchat_adminpass" then
sql="Select * From [sanchat_adminpass] WHERE [user]='" & Request("user_name") & "' AND [password]='" & Base64encode(Request("password")) & "'"
Set rs=Con.Execute(sql)
if rs.eof then
Response.Redirect "error.htm"
objSchema.Close
Set objSchema=nothing
Con.Close
Set Con=nothing
else
session("admin")=true
session("user_name")=Request("user_name")
Response.Redirect "index.asp"
objSchema.Close
Set objSchema=nothing
Con.Close
Set Con=nothing
end if
end if
objSchema.MoveNext
Loop
sql="Create Table [sanchat_adminpass] ([user] VarChar(50) IDENTITY PRIMARY KEY, [password] VarChar(50))"
Con.Execute(sql)
sql="Insert INTO [sanchat_adminpass] VALUES ('" & Request("user_name") & "','" & Base64encode(Request("password")) & "')"
Con.Execute(sql)
session("admin")=true
session("user_name")=Request("user_name")
objSchema.Close
Set objSchema=nothing
Con.Close
Set Con=nothing
response.redirect "first.htm"
else
%>
<html>
<head>
<title>SanChat 数据库管理 [asp]</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="master.css" type="text/css">
</head>
<body bgcolor="#efefff" text="#000000">
<div align="center">
<p><font face="宋体" size="3"><b>SanChat数据库管理 [asp]</b></font></p>
<p> </p>
<form action="default.asp" method="post">
<table width="241" border="1" cellpadding="0" cellspacing="0">
<tr>
<td width="104" class="form">
<div align="center">用户名</div>
</td>
<td width="131" class="form">
<div align="center">
<input type="text" name="user_name" size="15">
</div>
</td>
</tr>
<tr>
<td width="104" class="form">
<div align="center">密码</div>
</td>
<td width="131" class="form">
<div align="center">
<input type="password" name="password" size="15">
</div>
</td>
</tr>
<tr>
<td colspan="2" class="form">
<div align="center"></div>
<div align="center">
<input type="submit" name="Submit" value="提交">
<input type="reset" name="ReSet" value="重设">
</div>
</td>
</tr>
</table>
</form>
<p> </p>
<table width="265" border="0" cellpadding="0" cellspacing="0">
</table>
<p> </p>
</div>
</body>
</html>
<%end if%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -