planetsim wrote:$emailAddr = ""; //just empty for now.
swtich ($_POST['subject']) //assuming subject is a form name
{
case 'option1':
$emailAddr = "myEmail@email.com";
break; //add other cases
default:
$emailAddr = "error@email.com"; //if an option doesnt exist this case "default" is selected
break;
}
// send the email off to $emailAddr or additional emails if need be
Hi again. Sorry for asking all of these questions, but I'm still a little lost. I've never used PHP form handlers before so I'm not sure how to code this.
Do I just get the HTML form to execute something like mail.php4, with the above code in that file? So would it look like:
<?php
$emailAddr = ""; //just empty for now.
swtich ($_POST['subject']) //assuming subject is a form name
{
case 'option1':
$emailAddr = "myEmail@email.com";
break; //add other cases
case 'option2':
$emailAddr = "myEmail@email.com";
break; //add other cases
case 'option3':
$emailAddr = "myEmail@email.com";
break; //add other cases
case 'option4':
$emailAddr = "myEmail@email.com";
break; //add other cases
case 'option5':
$emailAddr = "myEmail@email.com";
break; //add other cases
default:
$emailAddr = "error@email.com"; //if an option doesnt exist this case "default" is selected
break;
}
// send the email off to $emailAddr or additional emails if need be
Is that correct? How about the variables for the comment field, From field, BCC, CC, etc?
thanks so much.