Writing the Configuration Scripts

This Web site will make use of two configuration-type scripts. One, config.inc, will manage errors. The other, mysql_connect.php, will store all of the database-related information.

Making a configuration file

The sole purpose of the configuration file will be to set the error-management policy of the site. During the development stages, I’ll want every error reported and, when one occurs, a bold error message should be printed to the Web browser (Figure 12.3). During the production, or live, stage of the site, I’ll want to handle errors more gracefully. At that time, I’ll turn error reporting off entirely and have an email sent when one does occur. With any luck that should rarely be necessary.

Figure 12.3. ...

Get PHP and MySQL for Dynamic Web Sites: Visual QuickPro Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.