Page 1 of 1

Handling Errors Messages with Users

Posted: Thu Feb 12, 2004 8:15 am
by crandym
What would be the most appropropriate way to handle user communitations with respects to errors?

I have written some error handling functions. Depending on the type of error, I log the error to a file, send an automated email to technical support, or communicate back to the user.

In various forms, I use javascript to check for data input errors and use alert in the event something is not valid.

What approach is best to use in functions such as database interface errors, or during file uploads if invalid file types are uploaded. In these cases, I have various php submit files that handle validity checking, but these files have no html or javascript constructs.

I was originally hoping for an easy way to send an error message to a php function which pops up an error display window for the user. Unfortunately, the php function is in an include file with no html - making it difficult for javascript to play a role. Also because the php submit file contains no html, javascript is unable to play a role there either.

Bottom line, what is the recommended approach for handling user communication in php code or functions and is it advisable to exit the routine in order to communicate to the user or allow the routine to continue and try communicating the message in a popup?

thanx

crandym