Php user password modification code
- @ Session_start ();
- Require_once ("../inc/ring_admin.php ");
- Require_once ("../inc/connect. php ");
- Require_once (".../../admin/inc/function. php ");
- Ring_login ();
- $ Pwd = get_value ('pwd', 'post ');
- $ Pwd2 = get_value ('pwd2 ', 'post ');
- $ Pwd3 = get_value ('pwd3 ', 'post ');
- $ SQL = "select * from gx_member where m_pwd = '". md5 ($ pwd ). "'and m_name = '". $ _ SESSION ['uid']. "'";
-
- If ($ pwd2! = $ Pwd3 | strlen ($ pwd2) <6 | strlen ($ pwd2)> 12 ){
- Alert ('the new password entered twice is incorrect. please try again! ','');
- } Else {
- If (mysql_num_rows (mysql_query ($ SQL ))){
- $ SQL = "Update gx_member set m_pwd = '". md5 ($ pwd2). "'Where m_name ='". $ _ SESSION ['uid']. "'";
- Mysql_query ($ SQL) or die (mysql_error ());
- Alert ('password modified! ','');
- } Else {
- Alert ('the old password is incorrect. please try again! ','');
- }
- }
- ?>
|