try { $item = Todo::read($id); } catch (Exception $e) { } } } //changes to update mode if (isset($_GET['update']) && isset($_GET['item_id'])) { if (filter_var($_GET['item_id'], FILTER_VALIDATE_INT)) { $update_mode = true; } } //mark item as complete if (isset($_GET['mark_complete']) && isset($_GET['id'])) { if (filter_var($_GET['id'], FILTER_VALIDATE_INT)) { Todo::mark_complete($_GET['id']); refresh(); } } ?> <!DOCTYPE html> <head> <title>Simple Todo</title> <link rel="stylesheet" href="static/styles.css"> </head> <body> <?php if (isset($update_mode)) { if ($update_mode) { $data = Todo::read($_GET['item_id']);