|
Posted by Ψrjan Langbakk on 12/18/99 11:51
I have a form where the user has the possibility to enclose his name.
email, address and phonenumber.
I want to be able to check if some of the fields are filled - at least
one. This is so that we have some way to contact the customer.
Today I check for the existence of an email-address, and a validation
code - what I need is a way to check, eg. whether email _or_ phone is
entered, and if none is entered, display an errorpage.
Today, my code looks like this:
if (empty( $_POST["mail_adresse"])) {
header( "Location: error_mail.php" );
}
elseif ($valkode != $sjekkode) {
header( "Location: error_kode.php" );
}
else {
mail("[lots of vaiables]", "From: $adrs" );
}
What I would like is some way to _always_ check for the correct code
being entered, but allow for either email, phonenumber or both being
present.
I've tried with || and && and other ways to check for more than one
variable in the if-statement, but I can't seem to get it right...
Any tips?
--
mvh
Γrjan Langbakk
http://www.bergenpchjelp.no
http://www.cubic-design.net
Navigation:
[Reply to this message]
|