Somewhat new to Php. I inherited a simple piece of email processing code that stores the submitted form fields in the $message variable. Their are some fields that may not exist when the form is submitted so I'd like to not include them.
The second row (AddName2) is an example of a row I don't want to include in the email submission if it doesn't exist:
I tested unsuccessfully like this:
Thanks in advance.
The second row (AddName2) is an example of a row I don't want to include in the email submission if it doesn't exist:
Code:
$message = "Date: " . date("F d, Y") . " $n <table> <tr><th $headerStyle >Name</th><td>" . $this->AddName1 . "</td></tr> <tr><th $headerStyle >Name</th><td>" . $this->AddName2 . "</td></tr> <table> ";
Code:
if (isset($_POST["AddName2"])) { <tr><th $headerStyle >Name</th><td>" . $this->AddName2 . "</td></tr> " . } . "
Comment