handle !== $_POST["handle"]) { $stmt = $db["data"]->prepare( "SELECT COUNT(*) FROM members WHERE UPPER(handle) = UPPER(:handle)" ); $stmt->execute([ "handle" => $data["handle"], ]); if ($stmt->fetch(PDO::FETCH_COLUMN) > 0) { $errors["handle"] = "That handle is taken."; } } if ($_SESSION["account"]->email !== $_POST["email"]) { $stmt = $db["data"]->prepare( "SELECT COUNT(*) FROM members WHERE email = :email" ); $stmt->execute([ "email" => $data["email"], ]); if ($stmt->fetch(PDO::FETCH_COLUMN) > 0) { $errors["email"] = "That email address is already in use."; } } if ( $_POST["password"] && $_POST["new-password"] && !password_check($_SESSION["account"]) ) { $errors["password"] = "Your password is incorrect."; } if ($_POST["password"] && mb_strlen(trim($_POST["new-password"])) === 0) { $errors["new-password"] = "You can't have an empty password."; } if ( $_POST["password"] && $_POST["new-password"] && $_POST["new-password"] !== $_POST["new-password-confirm"] ) { $errors["new-password"] = "The newly-entered passwords do not match."; } return $errors; } if ($_SERVER["REQUEST_METHOD"] === "POST"): $errors = validate_fields($_POST); if ( !isset($errors["name"]) && !isset($errors["handle"]) && !isset($errors["biography"]) ) { $stmt = $db["data"]->prepare( "UPDATE members SET (name, handle, biography) = (:name, :handle, :biography) WHERE id = :id" ); $stmt->execute([ "id" => $_SESSION["account"]->id, "name" => $_POST["name"], "handle" => $_POST["handle"], "biography" => $_POST["biography"] ?? null, ]); } if ( ($_SESSION["account"]->email !== $_POST["email"] || $_POST["password"]) && !isset($errors["email"]) && !isset($errors["new-password"]) && !isset($errors["new-password"]) ) { $stmt = $db["data"]->prepare( "UPDATE members SET (email, password) = (:email, :password) WHERE id = :id" ); $password = $_POST["new-password"] ? password_hash($_POST["new-password"], PASSWORD_ARGON2ID) : $_SESSION["account"]->password; $stmt->execute([ "id" => $_SESSION["account"]->id, "email" => $_POST["email"], "password" => $password, ]); } $stmt = $db["data"]->prepare("SELECT * FROM members WHERE id = :id"); $results = $stmt->execute([ "id" => $_SESSION["account"]->id, ]); $_SESSION["account"] = $stmt->fetch(PDO::FETCH_OBJ); if (count($errors) > 0) { http_response_code(400); } else { $_SESSION["profile_updated"] = true; http_response_code(303); header("Location: /account/edit"); die(); } endif; include "partials/head.php"; ?>

You must log in to view this page.

The ability to upload a photo and add links to your profile will return soon; your existing photo and links are still visible.

View your profile

Personal Details
Account Security
Change Password