http://expert.csdn.net/Expert/topic/1564/1564803.xml?temp=.6016657

解决方案 »

  1.   

    <%session("userid")=userid%>
    <%session("userpwd")=userpwd%> 
    <!--#include file="dbconn.inc"-->
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>修改密码</title>
    <style type="text/css">
    td{font-size:9pt}
    a:link,a:visited,a:actived{text-decoration:underline;color="#0000ff"}
    a:hover{text-decoration:underline;color="#ff0000"}
    </style>
    </head>  
    <%
    userid=request("userid")
    userpwd=request("userpwd")
    sql="select * from t_kfqy_user where userid='"+userid+"' and userpwd='"+userpwd+"'"
    rs.open sql, conn, 3
    %>
    <body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
    <table border="0" width="776" cellspacing="0" cellpadding="0" align="center" >
      <tr>
        <td width="100%" style="padding-left: 30px">
        <br/>
          
          <form name="form1" method="post" action="editpwdsave.asp?userid=<%=rs("userid")%>">
            <table border="0" width="618" cellspacing="1" cellpadding="4" style="border-left: medium none; border-right: medium none; border-top: 1px none rgb(255,188,155); border-bottom: 1px none rgb(255,255,255); margin-left: 16px; margin-top: 10px; padding-left: 4px" bgcolor="#120506" align="center">
              <tr bgcolor="#FFFFFF"> 
                <td height="30" colspan="2"> 
                  <div align="center"> 
                    <center>
                      <p><font color="#FFFFFF"><b><font color="#FFFFFF"><b><font color="#000000">修改</font></b></font><font color="#000000">密码</font></b></font>
                    </center>
                  </div>
                </td>
              </tr>
              <tr> 
                <td width="107" height="30" bgcolor="#FFFFFF" align="center"> 
                  <div align="left"> 
                    <p><font color="#000000">用户名:</font> 
                  </div>
                </td>
                <td width="492" height="30" bgcolor="#FFFFFF" align="center"> 
                  <div align="left"> 
                    <p><font color="#000000"> <%=rs("userid")%> </font> 
                  </div>
                </td>
              </tr>
              <tr> 
                <td width="107" height="30" bgcolor="#FFFFFF" align="center"> 
                  <div align="left"> 
                    <p><font color="#FF0000">*<font color="#000000">新</font></font><font color="#000000">密码:</font> 
                  </div>
                </td>
                <td width="492" height="30" bgcolor="#FFFFFF" align="center"> 
                  <div align="left"> 
                    <p> 
                      <input type="password" name="userpwd" size="30">
                  </div>
                </td>
              </tr>
              <tr> 
                <td width="107" height="30" bgcolor="#FFFFFF" align="center"> 
                  <div align="left"> 
                    <p><font color="#FF0000">*</font><font color="#000000">确认密码:</font> 
                  </div>
                </td>
                <td width="492" height="30" bgcolor="#FFFFFF" align="center"> 
                  <div align="left"> 
                    <p> 
                      <input type="password" name="pwd_c" size="30">
                  </div>
                </td>
              </tr>
              <tr> 
                <td height="30" bgcolor="#FFFFFF" colspan="2" align="center"> 
                  <div align="left"> 
                    <p align="center"> 
                      <input type="submit" value="修 改" name="submit" style="font-size: 9pt">
                           &nbsp;&nbsp; 
                      <input type="reset" value="清 除" name="q" style="font-size: 9pt">
                  </div>
                </td>
              </tr>
            </table>
          </form>
            
          <p align="center"> 
        </td>
      </tr>
    </table>
    </body>
    </html>editsave.asp   ------------------->
    <!--#include file="dbconn.inc"-->
    <html>
    <head>
    <title>修改密码 </title>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <style type="text/css">
    p,td,div{font-size:9pt}
    </style>
    </head>
    <%userid=request("userid") 
      userpwd=request("userpwd")
      pwd_c=request("pwd_c")
      sql="update t_kfqy_user set userpwd='"+userpwd+"',pwd_c='"+pwd_c+"  where userid='"+userid&"'"
      set rs=conn.execute(sql)
      
    %>
    <body bgcolor="#FFFFFF" link="#0000FF" vlink="#FF0000">
    <p>&nbsp;</p><table border="0" width="200" cellspacing="0" cellpadding="0" style="padding-left: 10px" align="center">
      <tr> 
        <td width="100%" style="padding-left: 30px"><font color="#FF0000" size="+1">修改成功!<br/>
          <br/>
          <a href="#" onclick="window.history.go(-1)">点击这里返回!</a></font></td>
      </tr>
    </table>
    </body>
    </html>
      

  2.   

    pengdali(大力) 不行呀,内部服务器错误ASP连接Sqlserver数据库语句  添加在头部吗?
      

  3.   

    1.输入新密码的页面-------------------------------------------------
    <%
    Option Explicit
    %>
    <html>
    <head>
    <title>输入新密码</title>
    <script language="javascript">
    function submitok(){
    var pwdissame
    pwdissame = trueif((document.changePwd.pwd1.value == "")&&pwdissame){
    alert("密码不能为空!")
    pwdissame = false
    }
    if((document.changePwd.pwd2.value == "")&&pwdissame){
    alert("请确认密码!")
    pwdissame = false
    }
    if((document.changePwd.pwd1.value != document.changePwd.pwd2.value)&&pwdissame){
    alert("两次密码不匹配!")
    pwdissame = false
    }
    return pwdissame
    }
    </script>
    </head>
    <body>
    <form name="changePwd" action="SaveNewPwd.asp" method="post" onsubmit="return submitok()">
    <input type="hidden" name="username" value="<% =request.form("username")%>">
    <input type="hidden" name="oldpassword" value="<% =request.form("password")%>">请输入新密码:<input type="password" name="pwd1">
    <br/>
    请重复新密码:<input type="password" name="pwd2">
    <br/>
    <input type="submit" value="提交">
    </form>
    </body>
    2.处理页面SaveNewPwd.asp------------------------------------------
    <%
    Option Explicit
    dim conn,DBPath
    dim rs_user
    dim sql
    dim username,oldpassword,password1   username     =left(request("username"),10)
       oldpassword =left(request("password"),10)
       password1  =   request.form("password1")
       '-----------------创建数据库连接----------------
    Set conn = Server.CreateObject("ADODB.Connection")
    DBPath = Server.MapPath("wangmi.mdb")
    conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DBPath'------------------修改密码----------------------
    conn.execute "update user_reg set password = '"&password1&"' where username='"&username&"' and password='"&oldpassword&"'"
    %>---------------------完成--------------------
    到asp版去问吧!这是SQL版!!!