PDO::ERRMODE_WARNING, PDO::ATTR_PERSISTENT=>PERSISTENT]); }catch(PDOException $e){ die('No Connection to MySQL database!'); } session_start(); $user=check_login(); $msg=''; if($_SERVER['REQUEST_METHOD']==='POST'){ if(!isset($_POST['pass']) || !password_verify($_POST['pass'], $user['password'])){ $msg.='
Wrong password.
'; }else{ $stmt=$db->prepare('UPDATE users SET todelete=1 WHERE id=?;'); $stmt->execute([$user['id']]); session_destroy(); header('Location: login.php'); exit; } } header('Content-Type: text/html; charset=UTF-8'); ?>This will delete your account and all data asociated with it. It can't be un-done. Are you sure?