if (!empty($_POST['action'])) { $errors = array(); if ($_POST['action'] == "change-password") { if (!$qbc->verifyPassword($_POST['current-password'])) { $errors[] = "Current password doesn't match."; } else { if (empty($_POST['password'])) { $errors[] = "Password can not be empty."; } else { if ($_POST['password'] != $_POST['password-confirm']) { $errors[] = "Passwords do not match."; } } } if (empty($errors)) { $qbc->updatePassword($_POST['password']); header("Location: myaccount.php?success=1"); } } } ?> <!doctype html> <html lang="us"> <head> <meta charset="utf-8"> <title>Coreference Tool - My Account</title> <link href="css/smoothness/jquery-ui-1.10.4.custom.css" rel="stylesheet"> <link href="css/bootstrap.min.css" rel="stylesheet" media="screen"> <link href="css/bootstrap-theme.min.css" rel="stylesheet" media="screen"> <link href="css/coref.css" rel="stylesheet"> <script src="js/jquery-1.10.2.js"></script>