📄 login_check.asp
字号:
<% response.buffer=true %>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>通用登录系统</title>
<meta name="GENERATOR" content="Microsoft FrontPage 6.0">
<script language="jscript">
<!--
function Check()
{
var NotNull
NotNull=true
if (document.Login.UID.value=="")
{
window.alert("请输入姓名")
NotNull=false
}
if (document.Login.PWD.value=="")
{
window.alert("请输入密码")
NotNull=false
}
return NotNull
}
//-->
</script>
<style type="text/css">
<!--
a:visited,a:link { text-decoration: none; color: #003399}
a:hover { text-decoration: none; color: #3333FF}
a.linkwhite:link,a.linkwhite:visited { text-decoration:none; color:white}
a.linkwhite:hover { text-decoration: underline; color:white}
a.linkblack:link,a.linkblack:visited { text-decoration:none; color:black}
a.linkblack:hover { text-decoration: underline; color:black}
input { font-family: "宋体"; font-size: 9pt}
td { font-family: "宋体"; font-size: 9pt; color: #000000}
.en { font-family:"Verdana", "Arial"; font-size: 9pt}
.white { color: #FFFFFF}
.line { line-height: 20px}
.title { font-size: 14px }
-->
</style>
</head>
<body>
<%
if request.Servervariables("request_method")="POST" then
Dim ConnStr,myConn,mySQL
myID=request.form("uid")
myPWD=request.form("pwd")
if myID<>"" then
ConnStr="Provider=SQLOLEDB;data source=(local);initial catalog=masterasp;user id=sa;password=;"
Set myConn=Server.CreateObject ("ADODB.Connection")
Myconn. ConnectionString=ConnStr
myConn.open '直接打开数据库连接
set myComm = Server.CreateObject("ADODB.COMMAND")
with myComm
.ActiveConnection = myConn
.CommandText ="findmember"
.CommandType =adCmdStoredProc
'创建存储过程参数
'获取存储过程的返回值,只需要设定CreateParameter的第3个参数为adParamReturnValue就可以了
set myPar=.CreateParameter("RetVal",adInteger,adParamReturnValue)
'将创建的参数添加到参数列表中
.Parameters.Append myPar
set myPar1=.CreateParameter("@UserID",adVarChar,adParamInput,50)
'将创建的参数添加到参数列表中
.Parameters.Append myPar1
.Parameters("@UserID")=myID
set myPar2=.CreateParameter("@UserID",adVarChar,adParamInput,50)
'将创建的参数添加到参数列表中
.Parameters.Append myPar2
.Parameters("@UserPWD")=myPWD
'因为不需要创建记录集,因此可以直接执行
.Execute()
end with
if myComm.Parameters("RetVal")=0 then
response.write "用户名或者密码错误!"
else
response.write "你已经成功登录!"
response.end
end if
end if
end if
%>
<form name="Login" method="post" action="login_check.asp" align="center" onSubmit="return Check()">
<div ><table border="1" width="36%" bgColor="#ffe4b5" style="HEIGHT: 237px; WIDTH: 306px" bordercolor="#0000ff">
<tr>
<td width="100%" align="middle" bgcolor="#ffffff" bordercolor="#808080">
<strong><font face="黑体" color="#008080" size="5">通用登录系统</font></strong></td>
</tr>
<tr>
<td width="100%" align="middle" bgcolor="#ccffff">
<p style="BACKGROUND-COLOR: antiquewhite" align="center"><font color="#800080">
<font size="2">请输入用户名:</font><BR></font><input name="UID" maxlength="10" > <br><font color="#800080">请输入密码:<br></font><input type="password" name="PWD" maxlength="10" ><BR><BR></p><p align="center"><input type="submit" value="提交" name="submit"> <input type="reset" value="清除" name="Reset"></p>
<p align="center"><font face="楷体_GB2312">
<a href="../../chap9/explain.htm">会员注册</a></font></font></p></td></tr>
<center>
</table>
</div>
</form>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -