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

📄 userchgpsw.asp

📁 该资料包含大量网络开发的案例和源代码
💻 ASP
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%option explicit%>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<!--#include file="../include/datatransfer.asp"-->
<!--#include file="../include/functionjs.asp"-->
<!--#include file="../include/functionvb.asp" -->
<!--#include file="../include/md5.asp" -->
<!--#include file="../include/dbconn.inc" -->
<!--#include file="../include/refresh.asp"-->
<!--#include file="../include/header.asp" -->
<link href="../include/main.css" rel="stylesheet" type="text/css">
<%
if UserName=empty then	response.Redirect("../common/showerr.asp?ErrType=1")
%>

<table width="710" border="0" cellspacing="0" cellpadding="0" align="center" class="tablestyle">
  <tr>
    <td>
      
<%
	if request.QueryString("action")="chgpsw" then
		dim bev_title,bev_msg
		dim  oldpsw,newpsw1,newpsw2
		oldpsw=trim(request.form("oldpsw"))
		newpsw1=trim(request.form("newpsw1"))
		newpsw2=trim(request.form("newpsw2"))
	
		strSQL="select user_psw from user_info where user_id="& userid &" and user_psw='"&md5(oldpsw)&"'"
		objrs.open strsql,objconn,1,3
		if objrs.bof and objrs.eof then
			bev_title="错误信息--"
			bev_msg="密码输入错误<meta http-equiv='refresh' content=3;url='javascript:history.go(-1)'>"
		else
			objrs("user_psw")=md5(newpsw1)
			objrs.update
			bev_title="密码修改成功"
			bev_msg="<meta http-equiv='refresh' content=3;url='userinfo.asp?UserID=" & userid & "'>"
		end if
%>
	
	  <table width="710" border="0" cellpadding="2" cellspacing="1" bordercolor="#FFFFFF" bgcolor="#BDBABD">
  <tr>
    <td background="../resource/images/bj2.gif" bgcolor="#FFFFFF"><img src="../resource/images/bbs/li.gif" width="9" height="9"><a href="../blog/main.asp">56Blog</a>→<a href="userinfo.asp?UserID=<%=userid%>">用户信息</a>→修改密码结果</td>
    </tr>
    <tr bordercolor="#4C4C4C">
    <td align="center" background="../resource/images/bbs/bg.gif" bgcolor="#FFFFFF" class="tablehead"><%=bev_title%><%=bev_msg%></td>
    </tr>
  <tr>
    <td bgcolor="#FFFFFF"><table width="100%"  border="0" cellspacing="5" cellpadding="5">
        <tr>
          <td align="left"><a href="../blog/main.asp">返回首页</a> </td>
        </tr>
        <tr>
          <td align="left"><a href="userinfo.asp?UserID=<%=userid%>">返回用户信息</a></td>
        </tr>
        <tr>
          <td align="left"><a href="userchgpsw.asp">返回修改密码</a></td>
        </tr>
      </table></td>
    </tr>
</table>
<%else %>
<form  name="chgpsw" method="post" action="Userchgpsw.asp?action=chgpsw" onSubmit="return checkin(this)">
      <table width="710" border="0" cellpadding="5" cellspacing="1" bgcolor="#BDBABD">
	    <tr>
          <td colspan="2" background="../resource/images/bj2.gif"><img src="../resource/images/bbs/li.gif" width="9" height="9"><a href="../blog/main.asp">56Blog</a>→<a href="userinfo.asp?UserID=<%=userid%>">我的信息</a>→修改密码</td>
        </tr>
        <tr bordercolor="#4C4C4C">
          <td colspan="2"align="center" background="../resource/images/bbs/bg.gif" bgcolor="#FFFFFF" class="tablehead">修改密码</td>
        </tr>
        <tr bgcolor="#FFFFFF">
          <td width="355"><B>旧密码确认 </b>: <br>
      如要修改请输入旧密码进入确认</td>
          <td width="355">
            <input type="password" name="oldpsw">
          </td>
        </tr>
        <tr bgcolor="#FFFFFF">
          <td><B>新密码输入</b>: <br>
如要修改请直接输入新密码进入更新 (6-16位) </td>
          <td>
            <input type="password" name="newpsw1">
          </td>
        </tr>
        <tr bordercolor="#4C4C4C" bgcolor="#FFFFFF">
          <td><B>新密码确认 </b>: </td>
          <td>
            <input type="password" name="newpsw2">
          </td>
        </tr>
        <tr bordercolor="#4C4C4C" bgcolor="#FFFFFF">
          <td colspan="2"align="center">
            <input type="submit" name="button" value="修改" class="input">
            <input type="reset" name="reset" value="取消" class="input" >
          </td>
        </tr>
      </table>
	  </form>	  
<%end if%>
	</td>
  </tr>
</table>

<script language="vbscript">
Function checkin(myform)
checkin=true
if (trim(myform.oldpsw.value)="") then
  msgbox ("请填写旧密码!") 
  checkin= false
  exit function
end if

if (trim(myform.newpsw1.value)="") then
  msgbox ("请填写新密码!") 
  checkin= false
  exit function
end if

if (trim(myform.newpsw2.value)="") then
  msgbox ("请填写确认密码!") 
  checkin= false
  exit function
end if

if (len(myform.newpsw1.value)<6 or len(myform.newpsw1.value)>16) then
  msgbox ("用户名过长,请重新输入!") 
  checkin= false
  exit function
end if

if not trim(myform.newpsw1.value)=trim(myform.newpsw2.value) then
  msgbox ("新密码与确认密码不一致,请重新输入!")
  checkin= false
  exit function
end if
end Function
</script>

<!--#include file="../include/endconn.inc" -->
<!--#include file="../include/footer.asp" -->

⌨️ 快捷键说明

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