I am creating a form that our company uses to send denial emails to customers that we reject. The problem is, I need to know how to store form checkboxes as a variable, so i can use them in my mail_body.
the email has the following format:
you have been denied be cause of the following reasons:
reason1
reason2
reason3
...
Those reasons should be populated depending on what chechboxes you check within the form.
Here is what i'm working with:
$mail_body .= "$address"."\r\n";
$mail_body .= "$Date"."\r\n";
$mail_body .= "$Name".",\r\n";
$mail_body .= "RE: ".$app_num."\r\n";
$mail_body .= "$message";
//THIS IS WHERE I NEED TO USE THE VALUES FROM THE [B]CHECKED[/B] CHECKBOXES
$mail_body .= "$reason1";
$mail_body .= "$reason2";
$mail_body .= "$reason3";
$mail_body .= "$reason4";
$mail_body .= "$reason5";
//sending to
$recipient = "$Email";
$subject = "DENIED!";
//optional headerfields
$header = "From: " . $From . " <" . $From . ">\r\n";
//mail command
mail($recipient, $subject, $mail_body, $header);
}
echo "<div style='width:400px; margin:0 auto; border:1px solid #1e1e1e'>Your message has been sent successfully.<br>You will be redirected to the home page in a few moments...</div>";
//page redirect to home
echo "<meta http-equiv=\"refresh\" content=\"4;url=";
echo "http://lmtl-linux/credit\" />";
}
if (true == $show_form) {
?>
<div style="width:600px; margin:0 auto; border:1px solid black; background-color:#333333">
<p style="color:#FAFAFA; font-size:22px;">Customer Denial Emailer</p>
<form action="" method="GET" id="form">
<table>
<tr><td valign="top" class="title">Email:</td><td><input type="text" id="Email" name="Email" class="required email" value="<?php echo $_REQUEST['Email'];?>"></td></tr>
<tr><td valign="top" class="title">Name:</td><td><input type="text" id="Name" name="Name" class="required" value="<?php echo $_REQUEST['Name'];?>"></td></tr>
<tr><td valign="top" class="title">App #:</td><td><input type="text" id="Num" name="Num" class="required" value="<?php echo $_REQUEST['Num'];?>"></td></tr>
<tr><td valign="top" class="title">Reason:</td></tr>
<tr><td colspan="2" class="reason"><input type="checkbox" id="Reason1" name="Reason[]" value="Income insufficient to sustain payments">Income insufficent</td></tr>
<tr><td colspan="2" class="reason"><input type="checkbox" id="Reason2" name="Reason[]" value="Employment is not of sufficient length to qualify">Employment lenght insufficent</td></tr>
<tr><td colspan="2" class="reason"><input type="checkbox" id="Reason3" name="Reason[]" value="Limited or no credit history">Limited or no credit history</td></tr>
<tr><td colspan="2" class="reason"><input type="checkbox" id="Reason4" name="Reason[]" value="Derogatory credit reporting">Derogatory credit reporting</td></tr>
<tr><td colspan="2" class="reason"><input type="checkbox" id="Reason5" name="Reason[]" value="Bankruptcy, judgments, repossession, liens">Bankruptcy, reposession, etc.</td></tr>
</table>
</div>
<div style="width:650px; margin:0 auto;">
<input type="submit" name="Submit" id="Submit" value="Send Email" style="margin-left:22px; width:100px;">
</form>
I have tried using an array (and i can echo the checked values) - But I don't know how to store them as variables to use in my email.