asp 登录代码

来源:百度知道 编辑:UC知道 时间:2024/06/30 23:58:39
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<!--#include file="inc/conn.asp"-->
<!--#include file="inc/md5.asp"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
</head>

<body>

<%
dim pwd,pwd1,pwd2,username
username=trim(request.Form("username"))
pwd=trim(request.Form("password1"))
pwd1=trim(request.Form("n

<%
dim pwd,pwd1,pwd2,username
username=trim(request.Form("username"))
pwd=trim(request.Form("password1"))
pwd1=trim(request.Form("newpassword1"))
pwd2=trim(request.Form("newpassword2"))
sql="select * from userinfo where username='"&username&"'"
set rs=server.CreateObject("adodb.recordset")
rs.open sql,conn,1,3
if rs("password")<>md5(pwd) then
'从程序来看 你的数据库里面的密码应该加密过的 所以
response.Write("你的原始密码输入错误,请重新输入")

else

if pwd1=pwd2 then
rs("password")=md5(pwd1)
rs.update
success="修改成功"
response.Write(success)
else response.Write("你两次输入的密码不一样,请重新输入")
end if

end if
rs.close
set rs=nothing
response.Write("你已经成功的修改了密码】")
% >