0byt3m1n1
Path:
C:
/
wamp64
/
www
/
cpms_new
/
ADMIN
/
[
Home
]
File: password_ctrl.php
<?php require_once "creditList_ctrl.php"; //require_once "password.php"; if(isset($_POST['Submit'])) { $error_flag=0; $old=$_POST['txtold']; $new=$_POST['txtnew']; $confirm=$_POST['txtconfirm']; $result = creditDetails::getStaffDetails($username_global); if($result['password'] != $old) { $error['password_err']="Invalid password"; $error_flag=1; } if($old=="") { $error['old_null']="Please Enter your old password"; $error_flag=1; } if($new=="") { $error['new_null']="Please Enter your new password"; $error_flag=1; } if($confirm=="") { $error['confirm_null']="Please Re-Enter your new password"; $error_flag=1; } if($new != $confirm) { $error['mismatch']="Password Missmatch"; $error_flag=1; } if ($error_flag==0) { $sql="UPDATE `login` SET `passwd` = '$new' WHERE `username` = '$username_global'" ; mysql_query($sql); if (mysql_affected_rows()==1) { $error['message']="Password updated"; include("cgangepassword.php"); exit(); } } else { include("changepassword.php"); exit(); } } else { echo "Not set"; exit(); } ?>