From 99e2edb45abd9987c6526ba9be3ac301e03af713 Mon Sep 17 00:00:00 2001 From: ilotterytea Date: Sun, 20 Apr 2025 17:47:30 +0500 Subject: feat: alerts --- src/alert.php | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 src/alert.php (limited to 'src/alert.php') diff --git a/src/alert.php b/src/alert.php new file mode 100644 index 0000000..eb67f77 --- /dev/null +++ b/src/alert.php @@ -0,0 +1,33 @@ + $status, + "message" => $error, + "data" => null + ]); + } else { + header("Location: $path?error_status=$status&error_reason=$error"); + } +} + +function display_alert() +{ + if (!isset($_GET["error_status"], $_GET["error_reason"])) { + return; + } + + $status = $_GET["error_status"]; + $reason = str_safe($_GET["error_reason"], 50); + $ok = substr($status, 0, 1) == '2'; + + echo '' ?> +
+ +

+
+