Customizing Mail Form Error Pages

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
obi_wasabi
Forum Newbie
Posts: 15
Joined: Thu Dec 16, 2004 12:30 pm
Location: CA

Customizing Mail Form Error Pages

Post 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
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

what errors? I'd rather not just randomly type junk into your fields..
obi_wasabi
Forum Newbie
Posts: 15
Joined: Thu Dec 16, 2004 12:30 pm
Location: CA

Post 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!
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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.
obi_wasabi
Forum Newbie
Posts: 15
Joined: Thu Dec 16, 2004 12:30 pm
Location: CA

Post 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?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

adding layout around the errors.
obi_wasabi
Forum Newbie
Posts: 15
Joined: Thu Dec 16, 2004 12:30 pm
Location: CA

Post 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.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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 ;)
obi_wasabi
Forum Newbie
Posts: 15
Joined: Thu Dec 16, 2004 12:30 pm
Location: CA

Post 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.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post 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.
obi_wasabi
Forum Newbie
Posts: 15
Joined: Thu Dec 16, 2004 12:30 pm
Location: CA

Post 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.
Post Reply