From 1a112ab14becaf6d41cd34c176cbe563d4ca9742 Mon Sep 17 00:00:00 2001 From: "David T. Sadler" Date: Mon, 18 Oct 2021 21:15:18 +0100 Subject: Implement session management --- public/update/index.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'public/update') diff --git a/public/update/index.php b/public/update/index.php index fa6b482..50d0dcf 100644 --- a/public/update/index.php +++ b/public/update/index.php @@ -3,6 +3,7 @@ declare(strict_types=1); use DTS\BookmarkRepository; +use DTS\Session; use function DTS\Functions\respondAndExit; use function DTS\Functions\redirectAndExit; @@ -10,6 +11,8 @@ require_once(__DIR__.'/../../autoload.php'); $config = require_once(__DIR__.'/../../config.php'); +$session = Session::getInstance(); + if (filter_input(INPUT_SERVER, 'REQUEST_METHOD') !== 'POST') { respondAndExit(405, 'Method Not Allowed'); } @@ -32,4 +35,6 @@ if (!$bookmarks->update($bookmark)) { respondAndExit(500, 'Internal Server Error'); } +$session->set('message', 'Bookmark Updated'); + redirectAndExit('/'); -- cgit v1.2.3-13-gbd6f