diff --git a/add_process.php b/add_process.php index 0864a5e..0d35d08 100644 --- a/add_process.php +++ b/add_process.php @@ -19,11 +19,13 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST') { $stmt->execute([$name, $description]); } catch (PDOException $e) { // In a real app, log this error. For now, we'll just die. - die("Database error: " . $e->getMessage()); + error_log("DB Error: " . $e->getMessage()); + header('Location: index.php?error=dberror'); + exit; } // Redirect back to the main page after successful insertion - header('Location: index.php?success=1'); + header('Location: index.php?success=processadded'); exit; } else { // If not a POST request, redirect to the main page diff --git a/delete_process.php b/delete_process.php index 2387458..12c3a64 100644 --- a/delete_process.php +++ b/delete_process.php @@ -8,13 +8,20 @@ if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['id'])) { $pdo = db(); $stmt = $pdo->prepare("DELETE FROM processes WHERE id = :id"); $stmt->bindParam(':id', $id, PDO::PARAM_INT); - $stmt->execute(); + if ($stmt->execute()) { + header('Location: index.php?success=processdeleted'); + exit(); + } else { + header('Location: index.php?error=deletionfailed'); + exit(); + } } catch (PDOException $e) { error_log("DB Error: " . $e->getMessage()); - // Optionally, redirect with an error message + header('Location: index.php?error=dberror'); + exit(); } +} else { + header('Location: index.php?error=invalidrequest'); + exit(); } - -header('Location: index.php'); -exit(); ?> \ No newline at end of file diff --git a/index.php b/index.php index 0480963..45f8b55 100644 --- a/index.php +++ b/index.php @@ -37,6 +37,51 @@ $project_image_url = htmlspecialchars($_SERVER['PROJECT_IMAGE_URL'] ?? '');
+Define a process to begin analysis.
-