home *** CD-ROM | disk | FTP | other *** search
/ 202.53.64.216 / 202.53.64.216.tar / 202.53.64.216 / janahitha / AdsChangePwd.asp < prev    next >
Text File  |  2004-11-26  |  3KB  |  95 lines

  1. <!-- #include file="AdsOpenConn.asp" -->
  2. <%
  3.     if session("ClientId")="" then Response.Redirect "AdsLogin.asp"
  4.     if Request.Form.Count>0 then
  5.         set rs = server.createobject("adodb.recordset")
  6.         rs.open "select ClientPassword from ClientMaster where ClientLoginId='" + session("ClientLoginId") + "'", con, 3, 3
  7.         prevpassword = rs("ClientPassword")
  8.         set rs = nothing
  9.         curpassword = Request.Form("curpassword")
  10.         newpassword = Request.Form("newpassword")
  11.         if curpassword<>prevpassword then 
  12.             msg = "Current Password Does Not Match"
  13.         else
  14.             con.execute "update ClientMaster set ClientPassword='" + replace(trim(newpassword), "'", "''")+ "' where ClientLoginId='" + session("ClientLoginId") + "'"
  15.             Response.Redirect "AdsMyPage.asp?msg=cpw"
  16.         end if
  17.     end if
  18.     TblBorderColor = "#f2D197"
  19. %>
  20. <html>
  21.     <head>
  22.         <title> Janahitha Ads - Welcome </title>
  23.         <meta name="author" content="Jagadish,Gopi">
  24.         <script language="javascript" src="func.js"></script>
  25.         <script language="javascript">
  26.         function check()
  27.         {
  28.             validateform = document.changepwdform;
  29.             if(isempty(validateform.curpassword))
  30.                 validateform.curpassword.focus();
  31.             else
  32.             if(isempty(validateform.newpassword))
  33.                 validateform.newpassword.focus();
  34.             else
  35.             if(isempty(validateform.conpassword))
  36.                 validateform.conpassword.focus();
  37.             else
  38.             if(validateform.newpassword.value!=validateform.conpassword.value)
  39.             {
  40.                 alert("Password Does Not Match ! Enter Again !!");
  41.                 validateform.conpassword.focus();
  42.             }
  43.             else
  44.                 validateform.submit();
  45.         }
  46.         </script>
  47.     </head>
  48.     <body bottommargin=0 topmargin=0 leftmargin=0 rightmargin=0 marginheight=0 marginwidth=0 bgcolor=#ffffff>
  49.         <!-- #include file="AdsTop.asp" --> 
  50.         <center>
  51.         <table width=100% cellpadding=0 cellspacing=0 border=0 height=100%>
  52.         <tr>
  53.             <td width=150 align=center valign=top bgcolor="#FFFFFF">
  54.                 <!-- #include file="AdsLeft.asp" -->
  55.             </td>
  56.             <td width=630 align=center valign=top bgcolor="#ffffff">
  57.                 <br>
  58.                 <form name="changepwdform" method=post action="<%=Request.ServerVariables("script_name")%>">
  59.                 <font face="verdana" color="#846648"> <b> Change Password </b> </font> <br> <br>
  60.                 <%
  61.                     if msg<>"" then
  62.                 %>
  63.                 <font face=verdana size=2 color=red> <b> <%=msg%> </b> </font> <br> <br>
  64.                 <%
  65.                     end if
  66.                 %>
  67.                 <table cellpadding=0 cellspacing=0 border=0>
  68.                 <tr> <td bgcolor="<%=TblBorderColor%>">
  69.                 <table cellspacing=1 cellpadding=5 border=0>
  70.                 <tr bgcolor="#ffffff">
  71.                     <td> <font face="verdana" size=2> Current Password </font> </td>
  72.                     <td> <input type=text name="curpassword" size="15"> </td>
  73.                 </tr>
  74.                 <tr bgcolor="#ffffff">
  75.                     <td> <font face="verdana" size=2> New Password </font> </td>
  76.                     <td> <input type=password name="newpassword" size="15"> </td>
  77.                 </tr>
  78.                 <tr bgcolor="#ffffff">
  79.                     <td> <font face="verdana" size=2> Confirm Password </font> </td>
  80.                     <td> <input type=password name="conpassword" size="15"> </td>
  81.                 </tr>
  82.                 </table>
  83.                 </td> </tr>
  84.                 </table>
  85.                 <br>
  86.                 <input type=button value=" Change Now " onclick="javascript:check()" id=button1 name=button1>
  87.                 </form>
  88.             </td>
  89.         </tr>
  90.         </table>
  91.         </center>
  92.         <!-- #include file="AdsBottom.asp" -->
  93.     </body>
  94. </html>
  95. <!-- #include file="AdsCloseConn.asp" -->