query($sql); if ($result->num_rows > 0) { $admin = $result->fetch_assoc(); // Verify current password if (password_verify($current_password, $admin['password'])) { // Hash new password $hashed_password = password_hash($new_password, PASSWORD_DEFAULT); // Update password $update_sql = "UPDATE admins SET password = '$hashed_password' WHERE id = $admin_id"; if ($conn->query($update_sql)) { $success = "Password changed successfully!"; // Clear form fields $_POST = array(); } else { $error = "Failed to update password. Please try again."; } } else { $error = "Current password is incorrect"; } } else { $error = "Admin not found"; } } } $page_title = 'Change Password'; include '../includes/header.php'; ?>
← Back to Dashboard

Change Admin Password

Minimum 6 characters

🔒 Password Security Tips

  • Use at least 8 characters (minimum 6 required)
  • Mix uppercase and lowercase letters
  • Include numbers and special characters
  • Don't use common words or personal information
  • Change your password regularly