⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 passchange.asp

📁 功能最强大的ASP网站
💻 ASP
字号:
<!--#include file="../inc/conn.asp"-->
<%
FunCode="F103"
session("title")="用户密码修改"
session("headline")="首页 -> 注册系统 -> 用户密码修改"
%>
<!--#include file="../inc/head2.asp"-->

<%
if request("act")="update" then
	call update()
else
	call list()
end if

sub update()
oldpass=request("oldpass")
userpass1=request("userpass1")
userpass2=request("userpass2")

if oldpass="" or userpass1="" or userpass2="" then
		mesg="密码不能为空"
	session("mesg")=mesg
	Response.Redirect "../result.asp"
end if

if userpass1 <> userpass2 then
	mesg="两次输入的密码不一致"
	session("mesg")=mesg
	Response.Redirect "../result.asp"
end if

set rs=server.createobject("adodb.recordset")
sql="select * from [user] where username='"&session("username")&"'"
rs.open sql,conn,1,3
if rs("userpass")<> oldpass then
		mesg="旧密码不对"
	session("mesg")=mesg
	Response.Redirect "../result.asp"
end if

rs("userpass")=userpass1
rs.update
rs.close
set rs=nothing

	mesg="用户密码修改成功"
	session("mesg")=mesg
	Response.Redirect "../result.asp"
end sub

sub list()
%>
<script language='JavaScript'>
<!--
function check_input()
{
	passwd=document.passwdchange;
	if(passwd.oldpass.value=='')
	{
		alert('旧密码不能为空');
		passwd.oldpass.focus();
		return false;
	}
	if(passwd.userpass1.value=='')
	{
		alert('新密码不能为空');
		passwd.userpass1.focus();
		return false;
	}
	if(passwd.userpass2.value=='')
	{
		alert('新密码不能为空');
		passwd.userpass2.focus();
		return false;
	}
	if(passwd.userpass1.value!=passwd.userpass2.value)
	{
		alert('两次密码不一致');
		passwd.userpass1.focus();
		return false;
	}
}
//-->
</script>

            <br> <br> <br> <br> <br>
            <form name="passwdchange" method="POST" action="passchange.asp?act=update" onsubmit="return check_input()">
               <table border=1 bordercolor=#3770A9 bordercolordark=#ffffff cellpadding=3 
      cellspacing=0 width=40% class="size09" align="center">
	  <tr bgcolor="efefef"> 
                  <td colspan="2"> 
                  
                    <div align="center">
                    密码修改
                    </div>
                  </td>
                <tr> 
                  <td width="50%" bgcolor="#efefef"> 
                    <div align="center">旧 密 码</div>
                  </td>
                  <td width="50%"> 
                    <div align="center"> 
                      <input type="password" name="oldpass" size="20" class="form">
                    </div>
                  </td>
                </tr>
                <tr> 
                  <td width="50%" bgcolor="#efefef"> 
                    <div align="center">新 密 码</div>
                  </td>
                  <td width="50%"> 
                    <div align="center"> 
                      <input type="password" name="userpass1" size="20" class="form">
                    </div>
                  </td>
                </tr>
                <tr> 
                  <td width="50%" bgcolor="#efefef"> 
                    <div align="center">确认密码</div>
                  </td>
                  <td width="50%"> 
                    <div align="center">
                      <input type="password" name="userpass2" size="20" class="form">
                    </div>
                  </td>
                </tr>
                <tr bgcolor="efefef"> 
                  <td colspan="2"> 
                  
                    <div align="center">
                      <input type="submit" value="确  定" name="B1" style="text-align: center">
                    </div>
                  </td>
                </tr>
              </table>             
            </form>
<%end sub%>
<!--#include file="../inc/bottom2.asp"-->

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -