Thanks sir Dormilich,
but the cause of my problem is using sending email from 3 to 5 different email addresses... which is the value of text field for State will match each of dedicated (let say 4 email) address with different state location.
so let say if the user input Florida as the value of State in text field then the email match will be the
webmail1@email.com... and if Chicago, email match will be
webmail2@email.com and so on to the 4 emails. and if so the input do not match the 4 emails input of States.. it will deliver to the default value email
webmail@email.com...
and to the point of the 2nd value is, if the 2nd text field which is County of State will also do the same thing...
-
<?php
-
-
$value1 = $_POST['value1'];
-
$value2 = $_POST['value2'];
-
-
//Post Value in Text Field for Value 1 that will match the input of $value1
-
$text1 = /(Text1, Word1)/i";
-
$text2 = /(Text2, Word2)/i";
-
-
//Post Value in Text Field for Value 2 that will match the input of $value2
-
$text3 = /(Text3, Word3)/i";
-
$text4 = /(Text4, Word4)/i";
-
-
$text_value = array ($value1, $value2);
-
-
if (preg_match( $text1, $text_value )) {
-
$mail->AddAddress('webmail1@localhost.com');
-
} elseif (preg_match( $text2, $text_value )) {
-
$mail->AddAddress('webmail2@localhost.com');
-
} else {
-
$mail->AddAddress('webmail@localhost.com');
-
}
-
-
?>
-
i did a minor revision on the code.. and not sure if this is correct.
i'm open for your all helps and suggestions.. appreciation to all your help.