password update

Results 1 to 2 of 2

Thread: password update

  1. #1
    bobby Guest

    Default password update

    hai<BR>I got a problem with password updating. what actually i got is i had a page with loginid and password. if i click new password i will get a page where i give loginid , oldpassword now what my requirement 1)is i can change the password only if my old password is correct 2)new password and confirmpassword should be same than only i should update the old password.<BR>please send me code in asp for my requirement.

  2. #2
    Join Date
    Dec 1969

    Default RE: password update

    hi friend here i am sending code for your problem , you have to change table name according to your requiment.enjoy this code.<BR>bye<BR><BR><BR><BR>On error Resume Next<BR>QOT = "&#039"<BR><BR>if (UCase(UserId)&#060;&#062;"GUEST") then<BR> if (Request.Form("old_passwd") &#060;&#062; UserPwd) then<BR> DisplayMesg dm_Exclaim,"Password is incorrectly entered..."<BR> elseif (Request.Form("new_passwd") &#060;&#062; Request.Form("confirmpwd")) then<BR> DisplayMesg dm_info,"Confirm the New Password..."<BR> elseif (Request.Form("old_passwd") = Request.Form("confirmpwd")) then<BR> DisplayMesg dm_info,"Password has not been changed. Please enter a NEW password."<BR> else<BR> Set Conn = Server.CreateObject("ADODB.Connection")<BR> connstr = connection()<BR> connstr<BR> dim silsec<BR> dim newpwd<BR> Set silsec = Server.CreateObject("Silsecure.validaterights")<BR > newpwd= silsec.encrypt(Request.Form("new_passwd"))<BR><BR> SQLQuery = " UPDATE password SET Password = "& QOT & newpwd & QOT & _<BR> " WHERE UserId = " & QOT & UserId & QOT & " <BR> response.cookies("USRname")("UserId")=usr<BR> response.cookies("USRpassword")("Password")=newpwd <BR> response.cookies("USRs").domain="45.656.56.56"<BR> <BR><BR><BR> set silsec=nothing<BR> Set RS = Conn.Execute(SQLQuery)<BR> if err.number = 0 then<BR> NewPwdStr = UserId & ":" & Request.Form("new_passwd")<BR> response.AddHeader "NewPassword", NewPwdStr<BR> DisplayMesg dm_info,"Password changed successfully"<BR> else<BR> DisplayMesg dm_error,"Encountered error changing the Password " & err.Description<BR> end if<BR> end if<BR>Else<BR> DisplayMesg dm_error,"Guest&#039s Password Cannot be changed"<BR>End If<BR>Conn.close<BR>response.Flush

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts