asp用户登录程序
<!--#include file="setup.asp"-->
<!--#include file="check.asp"-->
<!--#include file="../inc/md5.asp"-->
<%
'=====================================================================
' 软件名称:新云网站管理系统
' 当前版本:NewCloud Site Management System Version 2.1
' 文件名称:admin_password.asp
' 更新日期:2004-12-20
' 官方网站:新云网络(www.newasp.net www.newasp.cn) QQ:94022511
'=====================================================================
' Copyright 2002-2005 newasp.net - All Rights Reserved.
' newasp is a trademark of newasp.net
'=====================================================================
Dim ID
Response.Write "<script language=""JavaScript"">" & vbCrLf
Response.Write "<!--" & vbCrLf
Response.Write "function CheckForm()" & vbCrLf
Response.Write "{" & vbCrLf
Response.Write "if (document.myform.password.value.length == 0)" & vbCrLf
Response.Write " {" & vbCrLf
Response.Write "alert(""请输入您的原始密码!"");" & vbCrLf
Response.Write "document.myform.password.focus();" & vbCrLf
Response.Write "return false;" & vbCrLf
Response.Write "}" & vbCrLf
Response.Write "if (document.myform.password1.value.length == 0)" & vbCrLf
Response.Write " {" & vbCrLf
Response.Write "alert(""请输入您的新密码!"");" & vbCrLf
Response.Write "document.myform.password1.focus();" & vbCrLf
Response.Write "return false;" & vbCrLf
Response.Write "}" & vbCrLf
Response.Write "if (document.myform.password2.value.length == 0)" & vbCrLf
Response.Write " {" & vbCrLf
Response.Write "alert(""请输入您的确认密码"");" & vbCrLf
Response.Write "document.myform.password2.focus();" & vbCrLf
Response.Write "return false;" & vbCrLf
Response.Write "}" & vbCrLf
Response.Write "return true;" & vbCrLf
Response.Write "}" & vbCrLf
Response.Write "//-->"
Response.Write "</script>" & vbCrLf
Admin_header
Dim Action
Action = LCase(Request("action"))
If Not ChkAdmin("ChangePassword") Then
Server.Transfer("showerr.asp")
Response.End
End If
Set Rs = Server.CreateObject("adodb.recordset")
Select Case Action
Case "save"
Call svaeadmin
Case Else
Call PassMain
End Select
If FoundErr = True Then
ReturnError(ErrMsg)
End If
Admin_footer
SaveLogInfo(AdminName)
CloseConn
Private Sub PassMain()
Response.Write "<table border=""0"" align=""center"" cellpadding=""2"" cellspacing=""1"" class=""tableBorder"">" & vbCrLf
Response.Write " <tr>" & vbCrLf
Response.Write " <th colspan=""2"">管理员名称及密码修改</th></tr>" & vbCrLf
Response.Write "<form method=Post name=""myform"" action=""admin_password.asp?action=save"" onSubmit=""return CheckForm();"">" & vbCrLf
Response.Write " <tr> " & vbCrLf
Response.Write " <td width=""25%"" align=""right"" nowrap class=""tablerow2"">管理员名称:</td>" & vbCrLf
Response.Write " <td class=""tablerow1"" width=""75%""> <INPUT type=text size=25 name=username value="""
Response.Write Session("AdminName")
Response.Write """> * <font COLOR=#FF0000>不修改可以留空</font></td>" & vbCrLf
Response.Write " </tr>" & vbCrLf
Response.Write " <tr> " & vbCrLf
Response.Write " <td align=""right"" nowrap class=""tablerow2"">原始密码:</td>" & vbCrLf
Response.Write " <td class=""tablerow1""> <INPUT type=password size=25 name=password></td>" & vbCrLf
Response.Write " </tr>" & vbCrLf
Response.Write " <tr> " & vbCrLf
Response.Write " <td align=""right"" nowrap class=""tablerow2"">新密码:</td>" & vbCrLf
Response.Write " <td class=""tablerow1""> <INPUT type=password size=25 name=password1></td>" & vbCrLf
Response.Write " </tr>" & vbCrLf
Response.Write " <tr> " & vbCrLf
Response.Write " <td align=""right"" nowrap class=""tablerow2"">确认新密码:</td>" & vbCrLf
Response.Write " <td class=""tablerow1""> <INPUT type=password size=25 name=password2></td>" & vbCrLf
Response.Write " </tr>" & vbCrLf
Response.Write " <tr> " & vbCrLf
Response.Write " <td align=""center"" colspan=""2"" class=""tablerow1"">" & vbCrLf
Response.Write "<INPUT type=hidden name=id value="""
Response.Write Session("Adminid")
Response.Write """>" & vbCrLf
Response.Write "<input type=""submit"" name=""Submit"" class=button value=""确认修改""> " & vbCrLf
Response.Write "</td>" & vbCrLf
Response.Write " </tr></form>" & vbCrLf
Response.Write "</table><BR>" & vbCrLf
End Sub
Private Sub svaeadmin()
Dim password
Set Rs = Server.CreateObject("ADODB.RecordSet")
password = md5(Request.Form("password"))
If Newasp.checkpost = False Then
ErrMsg = ErrMsg + "<li>您提交的数据不合法,请不要从外部提交注册。</li>"
founderr = True
End If
If InStr(Request("username"), "=") > 0 Or InStr(Request("username"), "%") > 0 Or InStr(Request("username"), Chr(32)) > 0 Or InStr(Request("username"), "?") > 0 Or InStr(Request("username"), "&") > 0 Or InStr(Request("username"), ";") > 0 Or InStr(Request("username"), ",") > 0 Or InStr(Request("username"), "'") > 0 Or InStr(Request("username"), ",") > 0 Or InStr(Request("username"), Chr(34)) > 0 Or InStr(Request("username"), Chr(9)) > 0 Or InStr(Request("username"), "
补充:asp教程,ASP入门