You guys are awesome! Thank you so much for answering this so quickly. I was missing a couple of .'s and ;'s but this is even more detailed than I expected!! The column trick and border was an excellent touch! Thank you all!
I have a php form that I want to send to an email, but it looks terrible with just
Name: Entered Name
Email: Entered Email
etc
Can anyone help me style this into a table, I keep getting errors trying to figure it out myself, and I've searched for examples but none use the type of code my form is using and i'm probably missing something. I believe this is the relevant section I need to do:
// If the e-mail is not working, change the debug option to 2 | $debug = 2;
$debug = 0;
$subject = $_POST['subject'];
$fields = array(
0 => array(
'text' => 'First Name',
'val' => $_POST['fname']
),
1 => array(
'text' => 'Last Name',
'val' => $_POST['lname']
),
2 => array(
'text' => 'Address',
'val' => $_POST['address']
),
3 => array(
'text' => 'City',
'val' => $_POST['city']
),
4 => array(
'text' => 'State',
'val' => $_POST['state']
),
5 => array(
'text' => 'Zip Code',
'val' => $_POST['zip']
),
6 => array(
'text' => 'Date of Birth',
'val' => $_POST['dob']
),
7 => array(
'text' => 'Phone Number',
'val' => $_POST['phone']
),
8 => array(
'text' => 'Email Address',
'val' => $_POST['email']
),
9 => array(
'text' => 'Position Desired',
'val' => $_POST['position']
),
10 => array(
'text' => 'Available Start Date',
'val' => $_POST['start']
),
11 => array(
'text' => 'Referred By',
'val' => $_POST['referred']
),
12 => array(
'text' => 'Additional Info',
'val' => $_POST['message']
)
);
$message = '';
$message .= '<h1>We Have a New Jobs Application!</h1>';
foreach($fields as $field) {
$message .= $field['text'].": " . htmlspecialchars($field['val'], ENT_QUOTES) . "<br>\n";
}
$mail = new PHPMailer(true);
$fields = [ ['text' => '...', 'val' => '...'], ['text' => '...', 'val' => '...'], and so on... ]