淮安市淮阴区海通花园:asp密码登录验证窗口制作

来源:百度文库 编辑:神马品牌网 时间:2024/05/02 01:46:36
制作一个密码登录验证窗口,要求与Access数据库结合,实现的密码的验证
登录具体要求如下:
1、 要求学生单独完成设计,课程设计结束时由老师检查合格者填写实验报

2、页面整洁,可以采用普通网页制作工具开发。
3、基本功能完备:
(1) 通过口令来验证登录用户身份;
(2) 密码错误或者用户名错误时,跳出错误信息;
(3) 全部信息验证正确时,就输出,跳转到欢迎页面。

登陆页面
<!--#include file="../Inc/conn.asp"-->
<!--#include file="../Inc/function.asp"-->
<%
Response.Buffer = True
Response.Expires = -1
Response.ExpiresAbsolute = Now() - 1
Response.Expires = 0
Response.CacheControl = "no-cache"
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><%=w_name%>后台管理</title>
<link href="admin_style.css" rel="stylesheet" type="text/css">
</head>
<body leftmargin="1" topmargin="0">
<table width="100%" height="307" border="0" cellpadding="0" cellspacing="1">
<tr>
<td height="305">
<table width="100" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><img src="../image/admin/Admin_01.gif" width="476" height="68"></td>
</tr>
<tr>
<td><img src="../image/admin/Admin_03.gif" width="476" height="29"></td>
</tr>
<tr>
<td height="101" background="../image/admin/Admin_04.gif"> <table width="264" border="0" align="center" cellpadding="0" cellspacing="1">
<form name="form1" method="post"action="admin_check.asp?action=login">
<tr valign="top">
<td width="22%" height="25"><font size="2"><strong><font color="#FFFFFF">用户名:</font></strong></font></td>
<td width="46%" height="25"><font size="2">
<input name="username" type="text" id="username" size="18" class="login">
</font></td>
<td width="32%" rowspan="2" align="center"><input type="image" name="Submit" value="提交" src="../image/admin/Admin_login_sub.gif" width="59"
height="49" onClick="document.form1.submit()"> </td>
</tr>
<tr>
<td height="25"><font size="2"><strong><font color="#FFFFFF">密 码:</font></strong></font></td>
<td height="25"><font size="2">
<input name="password" type="password" id="password" size="18" class="login">
</font></td>
</tr>
</form>
</table></td>
</tr>
<tr>
<td><img src="../image/admin/Admin_05.gif" width="476" height="22"></td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
验证页
<!--#include file="../Inc/conn.asp"-->
<!--#include file="../Inc/function.asp"-->
<!--#include file="../Inc/md5.asp"-->
<%
dim action,rs,sql,Username,Password,code
action=request.QueryString("action")
if action="login" then
Username=Replace_Text(request.Form("username"))
Password=md5(Replace_Text(request.Form("password")))
if Username="" or Password="" then
call showerr("用户名或密码不能为空")
response.end
end if
code=replace(trim(Request.form("code")),"'","")
if code="" then
call showerr("请输入验证码")
response.end
end if
if code<>CStr(session("CheckCode")) then
call showerr("你输入的验证码不正确,请重新输入")
response.end
end if
set rs=server.CreateObject("adodb.recordset")
sql="select Username,Password from Admin where Username='"&Username&"' and Password='"&Password&"'"
rs.open sql,conn,1,1
if rs.eof then
call rsclose
call dbclose
call showerr("用户名或密码错误")
else
session("adminname")=Username
session("adminpwd")=Password
response.Redirect("admin_index.asp")
call rsclose
call dbclose
end if
end if
%>

这个你应该到“编程”里去咨询。
告诉你个网站吧:http://www.vckbase.com到上面去找找看有没有合适的。