How to add a simple IF statement in this PHP file?
<p>Question by a novice, here:</p>

<p>I have a simple form returning a person's name, company, and address among other things.</p>

<p>Right now, these are returned on separate lines. If there is no entry in the "company" field, there is a blank line in the email that is sent.</p>

<p>I'd like to make an IF statement so that if there is no entry in the "company" field, that "address" will come back right after "name" without an extra space, but will include the "company" info if that field is filled-in.</p>

<p>The relevant part of the PHP code looks like this:</p>

<pre><code>$name = $_POST['name'];
$company = $_POST['company'];
$address = $_POST['address'];
$city = $_POST['city'];
$state = $_POST['state'];
$zip = $_POST['zip'];
$email = $_POST['email'];
$optin = $_POST['optin'];
$comments = ($_POST['comments']);



$body = &lt;&lt;&lt;EOD

Please send samples to:

$name
$company
$address
$city, $state $zip

Email: $email

Opt-In to occasional email list?: $optin

Comments: $comments

EOD;
$headers = "From: $email\r\n";
$success = mail($webMaster, $emailSubject, $body,
$headers);
</code></pre>

<p>I will really appreciate your help!</p>
