Re: [PHP] newbie - help with field variables in forms

2002-01-08 Thread Ivan Balazs

Hi!

A very simple way to do this is by checking the variables of the form (the
names of fields) if they are isset() or not. To be more specific you can
even check, if any of them is empty().
In special cases like the email address, i suggest using regexp to check
if it is a valid email address.

The structure i use for this:
if (isset($name_of_submit_button) {
here comes the checking part
if (error_occures) $error = true;
}
if (isset($name_of_submit_button) && !$error) {
send the email
} else {
show the form itself
}

this is my way, but there are other good solutions out there as well.

>
> I established an email feedback form, everything works fine, and now I'd
> like to add code to make a couple of fields required.  What function would I
> use for this and how would it be structured?
>
> Any help would be appreciated... thanks!
you're welcome
Balazs


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] newbie - help with field variables in forms

2002-01-08 Thread Andrea Caldwell

Hi there,

I'm really, really new at this (like 2 days into it) and never programmed
before (besides HTML)... so please bear with me.

I established an email feedback form, everything works fine, and now I'd
like to add code to make a couple of fields required.  What function would I
use for this and how would it be structured?

Any help would be appreciated... thanks!

Andrea



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]