<% flag1="n" mode=Request.QueryString ("mode") userid=trim(Request.Form ("user_id")) oldpassword=trim(Request.Form ("oldpassword")) newpassword=trim(Request.Form ("newpassword")) 'Response.Write userid 'Response.Write oldpassword if mode="check" then msg="" dim conn,rs dim strsql strqsl="" connstr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("tsl.mdb") set conn1 = Server.CreateObject("adodb.Connection") conn1.Open connstr set rs=server.createobject("adodb.recordset") strsql="select * from user_mast where user_id='"&userid&"' and user_password='"&oldpassword&"'" 'Response.Write strsql rs.Open strsql,conn1 if not rs.EOF then msg="" else msg="User Id and Old Password don't match." end if conn1.Close 'Response.Write "-------------"+msg 'Response.End if msg = "" then on error resume next set conn = Server.CreateObject("adodb.Connection") conn.open connstr 'Response.Write conn.State strsql="update user_mast set user_password='"& newpassword &"' where user_id='"& userid &"'" conn.Execute strsql 'Response.Write "--------->>>>"+strsql 'Response.end msg="Password changed successsfully" if Err.Description <> "" then Response.Write Err.description end if conn.Close flag1="y" end if end if 'Response.Write err.description if flag1="y" then 'Response.Write "Password change message" Response.Redirect("Login.asp?Flag=chkpwd") end if %>
CMS Traffic - Administrator Console
Set New Password