Page 1 of 1

Customizing Mail Form Error Pages

Posted: Wed Aug 31, 2005 9:12 am
by obi_wasabi
Hi,

Would someone offer a suggestion on customizing the php error page generated by the the mailform at the following url:

http://www.ckimedia.com/php_version/index.php

I searched by have not found anything really addressing the issue.

O/W

Posted: Wed Aug 31, 2005 9:19 am
by feyd
what errors? I'd rather not just randomly type junk into your fields..

Posted: Wed Aug 31, 2005 9:36 am
by obi_wasabi
feyd wrote:what errors? I'd rather not just randomly type junk into your fields..
Appreciated,

How does one correctly go about cusomizing the echo statments that are genereted when the first and last name are are not entered, and/or the zip and email are not valid

example, the following messages appear on a blank white page.

You forgot to enter your first name!

You forgot to enter your last name!

Would You like additional news?

Your Email is Invalid

Your Zipcode is Invalid.

Please Try Again!

Posted: Wed Aug 31, 2005 9:51 am
by feyd
ah, basic form validation.

d11wtq's simple form validation class may help or you can mix your own using isset(), empty(), regex, etc.

Posted: Wed Aug 31, 2005 10:15 am
by obi_wasabi
feyd wrote:ah, basic form validation.

d11wtq's simple form validation class may help or you can mix your own using isset(), empty(), regex, etc.
Hi the validaiton code is groovy, my boogle is with the strark page the error messages are displayed to. What suggestions exist for making the page consistent with the current design?

Posted: Wed Aug 31, 2005 10:21 am
by feyd
adding layout around the errors.

Posted: Wed Aug 31, 2005 10:44 am
by obi_wasabi
feyd wrote:adding layout around the errors.
Hi,

Any online examples of adding layout around the errors? I searched and found nothing.

Posted: Wed Aug 31, 2005 10:52 am
by feyd
it's just like adding layout around anything dynamic.. you can output the "header" stuff, then dynamic stuff, then "footer" stuff.. although the longer-in-tooth tend to move away from tightly integrated code and html output ;)

Posted: Wed Aug 31, 2005 10:59 am
by obi_wasabi
feyd wrote:it's just like adding layout around anything dynamic.. you can output the "header" stuff, then dynamic stuff, then "footer" stuff.. although the longer-in-tooth tend to move away from tightly integrated code and html output ;)
Would you elaborate on the longer-in-tooth moving away...? As I'm new to php best practices are a huge concern.

Posted: Wed Aug 31, 2005 11:03 am
by feyd
we either use template engines of some kind (intermediate and/or non-oop people, often), or rendering objects that can translate an object's properties into HTML, XML, Javascript or whatever we need it to end up as.

An example of a template engine is Smarty.

Posted: Wed Aug 31, 2005 11:33 am
by obi_wasabi
feyd wrote:we either use template engines of some kind (intermediate and/or non-oop people, often), or rendering objects that can translate an object's properties into HTML, XML, Javascript or whatever we need it to end up as.

An example of a template engine is Smarty.
Does an example exsist for my situation, the mail form errors? This is my first post and you've been extremely enlightening.