Documentation Index

About The ERROR.INI File

ERROR.INI is a minor INI file. However, there are plans to expand it's functionality.

This INI file — which is also in PHP format — has two basic functions. It defines special or generic messages for warnings and errors, and it has arrays of strings that can ban comments or sites visitors by IP address, web browser user agent or website referer.

Any message can be defined at the top of the file.

        WEEBLES = Weebles wobble but they don't fall down.

These error messages are retrieved by:

        $error = geterror('WEEBLES')

Then there are messages that can occur when submitting comments with bad or missing data. These messages are placed into a global which is referenced in the HTML template:

        {$GLOBALS['comment_message']}

Normally, the message is blank (and does not display). If the code detects an error condition it calls a function to set one of the global error messages. For example, if a user comment is submitted without data, the code is similar to:

        if ($data == "")
        	htmlseterror('SUBMIT')

$GLOBALS['comment_message'] is then set to the message defined in ERROR.INI under the section [SUBMIT] and the message gets displayed with the HTML template, the HTML automatically "adapting" (so to speak).

If you were to look at the code you would see that it is a little more complicated than that, but that is because we want to code to expand at some point to handle a wide range of messages.

Notes

1. We uppercase but that is not a requirement.