I got a situation that doesn't make any sense:
For some odd reason, the more fields that I enter information for (that are NOT required) adds more empty, white space to the top of the php page. It has something to do with all my if statements in the php. I viewed the source and there are not any extra breaks or anything to place the information something like 10 lines down...
Here is the php code:
<?php
// This is the address that the information submitted will be sent to.
$youremail="estroff@lasalle.edu";
// This will the email's subject
$emailsubject="Family weekend registration";
$hd = $HTTP_POST_VARS['hd'];
$mp = $HTTP_POST_VARS['mp'];
$imp = $HTTP_POST_VARS['imp'];
$hwd = $HTTP_POST_VARS['hwd'];
$jb = $HTTP_POST_VARS['jb'];
$bbq = $HTTP_POST_VARS['bbq'];
$fb = $HTTP_POST_VARS['fb'];
$bt = $HTTP_POST_VARS['bt'];
$mat = $HTTP_POST_VARS['mat'];
$fam = $HTTP_POST_VARS['fam'];
$bew = $HTTP_POST_VARS['bew'];
$fwl = $HTTP_POST_VARS['fwl'];
$brunch = $HTTP_POST_VARS['brunch'];
$museum = $HTTP_POST_VARS['museum'];
$fee = $HTTP_POST_VARS['fee'];
$first = $HTTP_POST_VARS['first'];
$last = $HTTP_POST_VARS['last'];
$sname = $HTTP_POST_VARS['sname'];
$address1 = $HTTP_POST_VARS['address1'];
$address2 = $HTTP_POST_VARS['address2'];
$city = $HTTP_POST_VARS['city'];
$state = $HTTP_POST_VARS['state'];
$zip = $HTTP_POST_VARS['zip'];
$email = $HTTP_POST_VARS['email'];
$classyear = $HTTP_POST_VARS['classyear'];
$id = $HTTP_POST_VARS['id'];
$phone1 = $HTTP_POST_VARS['phone1'];
$phone2 = $HTTP_POST_VARS['phone2'];
$phone3 = $HTTP_POST_VARS['phone3'];
$total = ($bbq 15) + ($mat 15 ) + ($fam 15) + ($brunch 15) + (20);
$mailbody.="Family weekend registration:\n\n";
$mailbody.="Name: $first" . " $last\n";
$mailbody.="Student's name: $sname\n\n";
if ($id != ""){
$mailbody.="Student ID: $id\n";
}
$mailbody.="Student's class year: $classyear\n";
$mailbody.="Address:\n $address1\n";
if ($address2 != ""){
$mailbody.="$address2\n";
}
$mailbody.="$city" . ", " . "$state" . " $zip\n\n";
$mailbody.="Email: $email\n\n";
// if phone1 is filled then then the others have to be...
if ($phone1 != ""){
$mailbody.="\nContact Phone Number: $phone1" . "-" . "$phone2" . "-" . "$phone2";
}
$mailbody.="\n\nNumber of people attending the following Events:\n\n";
if ($hd != ""){
$mailbody.="Harvest Dinner: $hd\n";
}
if ($imp != ""){
$mailbody.="Improv 101 Performance: $imp\n";
}
if ($mp != ""){
$mailbody.="Masque Production: $mp\n";
}
if ($hwd != ""){
$mailbody.="Hollywood Showdown: $hwd\n";
}
if ($jb != ""){
$mailbody.="Jazz Band Concert: $jb\n";
}
if ($bbq != ""){
$mailbody.="Go Explorers! Pre-game BBQ: $bbq\n";
}
if ($fb != ""){
$mailbody.="La Salle Football vs. Iona: $fb\n";
}
if ($bt != ""){
$mailbody.="Bus Trip to Center City: $bt\n";
}
if ($mat != ""){
$mailbody.="Mural Arts Tour: $mat\n";
}
if ($fam != ""){
$mailbody.="We are Family Celebration: $fam\n";
}
if ($bew != ""){
$mailbody.="Bewitched: $bew\n";
}
if ($fwl != ""){
$mailbody.="Family Weekend Liturgy: $fwl\n";
}
if ($brunch != ""){
$mailbody.="Family Brunch: $brunch\n";
}
if ($museum != ""){
$mailbody.="La Salle Art Museum Tours: $museum\n";
}
$mailbody.="Registration Fee: 20 dollars\n";
$mailbody.="Your total cost: $total dollars\n\n";
$mailbody.="Please mail a check with $total dollars to:\n The Parents Association\n La Salle University\n 1900 West Olney Ave., Box 809\n Philadelphia, PA 19141\n
or pay with your credit card by calling Helene Holmes at 215.951.1817";
$from_who="$email<". $email . ">";
// Send the email.
mail("$youremail", "$emailsubject", "$mailbody", "From: $from_who");
?>
<html>
<head>
<title></title>
<style type="text/css">
body, p, table, input, textarea, checkbox{
font-family:Verdana, Arial, Tahoma, Helvetica, sans-serif;
font-size:12px;
}
h3{
font-family:Verdana, Arial, Tahoma, Helvetica, sans-serif;
font-size:14px;
}
</style>
</head>
<body bgcolor="#FFFFFF" link="333399" vlink="cccc00" alink="cccc00">
<table width="75%" border="0" cellspacing="5" cellpadding="5" align="left">
<tr>
<td colspan="2"> <img src="/images/logo/logo_web.gif" width="180" height="50">
<br /><h3 align="center">Thank
you for taking the time to register for family weekend. <br />
See you soon!
</h3></td>
</tr>
<tr align="left" valign="top">
<td width="50%" align="right"><strong>First Name:</strong> </td>
<td width="50%"> <?php print $first ?></td>
</tr>
<tr align="left" valign="top">
<td align="right"><strong>Last Name:</strong></td>
<td> <?php print $last ?></td>
</tr>
<tr align="left" valign="top">
<td align="right"><strong>Student's Name :</strong> </td>
<td> <?php print $sname ?></td>
</tr>
<tr align="left" valign="top">
<td align="right"><strong>Address:</strong></td>
<td><?php print $address1 ?> </td>
</tr>
<?php
if ($address2 != ""){
print '<tr align="left" valign="top"><td align="right"></td><td>';
print $address2 ;
print '</td></tr>' ;
}
?>
<tr align="left" valign="top">
<td align="right"><strong>City:</strong></td>
<td> <?php print $city ?></td>
</tr>
<tr align="left" valign="top">
<td align="right"><strong>State:</strong></td>
<td><?php print $state ?></td>
</tr>
<tr align="left" valign="top">
<td align="right"> <strong>Zip:</strong></td>
<td><?php print $zip ?> </td>
</tr>
<tr align="left" valign="top">
<td align="right"><strong>E-mail Address:</strong></td>
<td><?php print $email ?></td>
</tr>
<?php
if ($imsn != ""){
print '<tr align="left" valign="top"><td align="right">Instant Messenger Screen Name: </td><td>';
print $imsn ;
print '</td></tr>' ;
}
?>
<?php
if ($imp != ""){
print '<tr align="left" valign="top"><td align="right">Instant Messenger Provider: </td><td>';
print $imp ;
print '</td></tr>' ;
}
?>
<tr align="left" valign="top">
<td align="right"><strong>Class year :</strong></td>
<td><?php print $classyear ?></td>
</tr>
<tr align="left" valign="top">
<td align="right"> </td>
<td> </td>
</tr>
<?php
if ($phone1 != ""){
print '<br /><tr align="left" valign="top"><td align="right">Contact Phone Number: </td><td>';
print $phone1 . "-" . $phone2 . "-" . $phone3;
print '</td></tr>' ;
}
?>
<tr align="left" valign="top">
<td align="center" colspan="2"><strong>The following number of people are attending these events:</strong></td>
</tr>
<?php
if ($hd != ""){
print '<br /><tr align="left" valign="top"><td align="right">Harvest Dinner: </td><td>';
print $hd;
print '</td></tr>' ;
}
if ($imp != ""){
print '<br /><tr align="left" valign="top"><td align="right">Improv 101 Performance: </td><td>';
print $imp;
print '</td></tr>' ;
}
if ($mp != ""){
print '<br /><tr align="left" valign="top"><td align="right">Masque Production: </td><td>';
print $mp;
print '</td></tr>' ;
}
if ($hwd != ""){
print '<br /><tr align="left" valign="top"><td align="right">Hollywood Showdown: </td><td>';
print $hwd;
print '</td></tr>' ;
}
if ($jb != ""){
print '<br /><tr align="left" valign="top"><td align="right">Jazz Band Concert: </td><td>';
print $jb;
print '</td></tr>' ;
}
if ($bbq != ""){
print '<br /><tr align="left" valign="top"><td align="right">Go Explorers! Pre-game BBQ: </td><td>';
print $bbq;
print '</td></tr>' ;
}
if ($fb != ""){
print '<br /><tr align="left" valign="top"><td align="right">La Salle Football vs. Iona: </td><td>';
print $fb;
print '</td></tr>' ;
}
if ($bt != ""){
print '<br /><tr align="left" valign="top"><td align="right">Bus Trip to Center City: </td><td>';
print $bt;
print '</td></tr>' ;
}
if ($mat != ""){
print '<br /><tr align="left" valign="top"><td align="right">Mural Arts Tour: </td><td>';
print $mat;
print '</td></tr>' ;
}
if ($fam != ""){
print '<br /><tr align="left" valign="top"><td align="right">We are Family Celebration: </td><td>';
print $fam;
print '</td></tr>' ;
}
if ($bew != ""){
print '<br /><tr align="left" valign="top"><td align="right">Bewitched: </td><td>';
print $bew;
print '</td></tr>' ;
}
if ($fwl != ""){
print '<br /><tr align="left" valign="top"><td align="right">Family Weekend Liturgy: </td><td>';
print $fwl;
print '</td></tr>' ;
}
if ($brunch != ""){
print '<br /><tr align="left" valign="top"><td align="right">Family Brunch: </td><td>';
print $brunch;
print '</td></tr>' ;
}
if ($museum != ""){
print '<br /><tr align="left" valign="top"><td align="right">La Salle Art Museum Tours: </td><td>';
print $museum;
print '</td></tr>' ;
}
?>
<tr align="left" valign="top">
<td align="right"><strong>Your total:</strong></td>
<td><?php print $total . " dollars" ?></td>
</tr>
<tr align="left" valign="top">
<td colspan="2">
<div align="center">Please mail a check with <?php print $total ?> dollars to: <br /><br />
The Parents Association<br />
La Salle University<br />
1900 West Olney Ave., Box 809<br />
Philadelphia, PA 19141<br />
or pay with your credit card by calling Helene Holmes at 215.951.1817
</div></td>
</tr>
</table>
</body>
</html>
THANK YOU!