Trapping error messages on custom built pages

Trapping error messages on custom built pages

Post by BeauDesign » Thu, 09 Feb 2006 03:13:45


Is there a tutorial or something that would help me figure out how to put up a
custom error page? I have a PHP page that is accessing a MySQL table which has
NOT NULL values for some fields. When the user does not enter data into a
field that requires data I want to be able to trap the error message that MySQL
throws and give the user a custom error page instead.

Or, should I be trapping the errors within my PHP and not allowing MySQL to be
the arbiter of errors?

Which approach is the correct one?
 
 
 

Trapping error messages on custom built pages

Post by Joe Makowi » Thu, 09 Feb 2006 03:20:13


Personally, I'd go for trapping them with PHP before they hit the
database. You can also use javascript form validation, but doing it
serverside with PHP is the only reliable way.

--
Joe Makowiec
http://www.yqcomputer.com/
Email: http://www.yqcomputer.com/

 
 
 

Trapping error messages on custom built pages

Post by Michael Fe » Thu, 09 Feb 2006 03:25:37

.oO(BeauDesigns)


Yep.

Micha
 
 
 

Trapping error messages on custom built pages

Post by Pat » Thu, 09 Feb 2006 04:54:52

It is also extremely advisable to set some database error catching to
rollback bad transactions etc.

Pat.
 
 
 

Trapping error messages on custom built pages

Post by BeauDesign » Mon, 27 Feb 2006 07:29:12

Thanks everyone for your replies. I've since purchased a product to help me with doing client and server side validations. I haven't got the server validations working yet but I have hope.
 
 
 

Trapping error messages on custom built pages

Post by Michael Fe » Tue, 28 Feb 2006 05:02:12

.oO(BeauDesigns)


Server-side validation is _much_ more important than client-side!

Micha