Activate Error Handler

This commit is contained in:
2025-05-29 23:14:57 +02:00
parent 1e33bdcf9b
commit 40ab6c4f03
+9 -24
View File
@@ -5,6 +5,14 @@ if (!isset($_SESSION["login"]) && $_SESSION["login"] != "true-as-hell") {
die(); die();
} }
function myErrorHandler($errno, $errstr, $errfile, $errline) {
echo "<p>Custom error:</p> [$errno] $errstr<br>";
echo "Error on line $errline in $errfile<br>";
}
// Set user-defined error handler function
set_error_handler("myErrorHandler");
$furatalog = new mysqli("localhost", "furatalog_admin_usr", "NR6tLk7c56bPT5[]", "furatalog"); $furatalog = new mysqli("localhost", "furatalog_admin_usr", "NR6tLk7c56bPT5[]", "furatalog");
$creator_name = $_POST["creator_name"]; $creator_name = $_POST["creator_name"];
@@ -51,7 +59,7 @@ if ($contentResult->num_rows == 0) {
, 1)"); , 1)");
$parsed_url = parse_url($content_url); $parsed_url = parse_url($content_url);
$clean_url = $parsed_url['scheme'] . '://' . $parsed_url['host'] . $parsed_url['path']; $clean_url = $parsed_url['scheme'] . '://' . $parsed_url['host'] . $parsed_url['path'];
@@ -113,27 +121,4 @@ if ($contentResult->num_rows == 0) {
} }
?> ?>