This is a piece of code from my update_profile.php page. It updates the password entered by user.
Here is the Form tat submittes the value:
what does it do is just run the last else statement
Where is tehe problem. Please help me.
Thanks
| Code: |
| else if(isset($_POST['p_submit']))
{ $password=$_SESSION['password']; // Session already keeps the previous md5ed password. $check=md5($_POST['new_password']); if(($_POST['new_password']==$_POST['confirm_password']) && $check!=$password) { $new_password=$_POST['new_password']; if(strlen($new_password) >=8 && strlen($new_password) <17) { $secure_password=md5($new_password); $update_query="UPDATE frsh_users SET password = '$secure_password' WHERE username = '$username' "; mysql_query($update_query)? $registeration_success=1 : $registeration_success=0; if($registeration_success) { $_SESSION['password']=$secure_password; $message[]="Records Updated. Password reset."; } else $errors[]='Problem accured while setting new password. Please try later.'; } else $errors[]='Password length improper. Please try to keep it between 8-16 characters.'; } else $errors[]='No need to update Records. New password is same as old one.'; //name="new_password"; //name="confirm_password"; } |
Here is the Form tat submittes the value:
| Code: |
| <form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
<input name="new_password" type="password" class="form_input" size="30" /> <input name="confirm_pass" type="password" class="form_input" size="30" /> <input name="p_submit" type="submit" value="Update" /> </form> |
what does it do is just run the last else statement
| Code: |
| else $errors[]='No need to update Records. New password is same as old one.'; |
Where is tehe problem. Please help me.
Thanks
