This is a vague question, but I am wondering if you guys can offer some advice on designing a better Error-Handler?!

Here is what I have now...

In each script, my Error-Handling Code looks like this...

PHP Code:
    // ************************
    // Check Section Format.    *
    // ************************
$validSections = array("finance""legal""management""small-business""xxx");

    if (
in_array($_GET['section'], $validSectionsFALSE)){
// Valid Section Format.
        // Continue processing things...

// Invalid Section Format.

// Set Error Source.
$_SESSION['errorPage'] = $_SERVER['SCRIPT_NAME'];

// Redirect to Display Outcome.
header("Location: " BASE_URL "/account/results.php");

// End script.

Then my "results.php" script does the following...

- Displays an Error Message to the User
- Logs the Error into a Database Table
- Emails the Admin if the Error could not be written to the Database
- Emails the Admin with a similar Error Message so he/she can stay informed of User/System Errors

For the Error Messages, I just use a gigantic Case statement like this...
PHP Code:
    // Invalid Section Format.
'<h1>Section Not Found</h1>';
'<p>The Section you chose cannot be found. (2421)</p>';
'<a class="button" href="' BASE_URL '/">Return to Home Page</a>';

Any thoughts or suggestions?

(BTW, I am still stuck with Procedural Code for now, so please don't offer any OOP suggestions as that's over my head for now?!)