Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Melvin Rivera's Blog:
Creating a custom WordPress database error page
Jun 19, 2006 @ 10:45:40

On the All Forces blog today, Melvin Rivera has posted a new tutorial for all of those WordPress users out there wanting to make a custom database error message page.

The database connection error occurs when WordPress tries o connect to the database but does not succeed at it. When you are first installing WordPress, it can mean that your settings are incorrect. i.e. the username/password are wrong. However, if your WordPress installation is running smoothly but for some reason MySQL goes down on your server then WordPress will show that huge "WordPress, Error Establishing a Database Connection" error page that looks nothing like the rest of your site.

The error page is great when you are first setting up WordPress but it is not the most ideal for a professional website. It creates confusion for the visitor that might not even know what WordPress is. What's worst, the web developer might not even find out for hours.

He guides you through making a small modification to WordPress itself (to change the page location), including the exact code to change. He also includes a brief it of PHP code to place on this custom page to email you whenever it hits this page (so you'll know it's down). From there, it's just about creating the custom error page that fits into your template. And, of course, he suggests testing it briefly, just to ensure that everything's on the up and up. Files are included where code was referenced.

tagged: wordpress tutorial custom error page email database down wordpress tutorial custom error page email database down

Link:


Trending Topics: