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/store/index.php | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 public/store/index.php (limited to 'public/store/index.php') diff --git a/public/store/index.php b/public/store/index.php new file mode 100644 index 0000000..2a84c59 --- /dev/null +++ b/public/store/index.php @@ -0,0 +1,33 @@ +id = bin2hex(random_bytes(32)); +$bookmark->url = $_POST['url']; +$bookmark->title = $_POST['title']; +$bookmark->tag = $_POST['tag']; +$bookmark->addedAt = date('Y-m-d H:i:s'); +$bookmark->unread = true; + +if (!$bookmarks->add($bookmark)) { + respondAndExit(500, 'Internal Server Error'); +} + +redirectAndExit('/'); -- cgit v1.2.3-13-gbd6f