Handling Comment Errors

So far we've just been looking at the way things are supposed to work, but what happens when something goes wrong? For example, let's say you've chosen not to allow anonymous comments on your site and someone tries to submit a comment without filling in the Email Address field.

In cases like that you wouldn't want to just silently reject the submitted comment and send the person back to the page he or she was just on. And you certainly wouldn't want your server to squawk back some cryptic error message like “Error 500: Internal Server Error.” This is exactly why Movable Type provides the Comment Error Template—so that you can present the visitor with information about what's gone wrong, and allow him or her a chance to ...

Get Sams Teach Yourself Movable Type in 24 Hours 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.