From cbaedbc5251f3b127bd81242d1344c0cd3e56e0c Mon Sep 17 00:00:00 2001 From: "David T. Sadler" Date: Wed, 13 Oct 2021 21:51:07 +0100 Subject: Implemente redirects --- public/update/index.php | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 public/update/index.php (limited to 'public/update') diff --git a/public/update/index.php b/public/update/index.php new file mode 100644 index 0000000..fa6b482 --- /dev/null +++ b/public/update/index.php @@ -0,0 +1,35 @@ +find($id); + +if ($bookmark === null) { + respondAndExit(404, 'Not Found'); +} + +$bookmark->url = $_POST['url']; +$bookmark->title = $_POST['title']; +$bookmark->tag = $_POST['tag']; + +if (!$bookmarks->update($bookmark)) { + respondAndExit(500, 'Internal Server Error'); +} + +redirectAndExit('/'); -- cgit v1.2.3-13-gbd6f