View Full Version : PHP froms - line breaks between body elements?

11-30-2006, 11:34 AM
Hello all,

Although basic, I seem to be struggling with laying out a PHP based web form. It executes to the desired inbox no problem; however, it’s not very legible as all the fields are bunched together without even a character break. The structure of the code is as follows:

$to = "enquiries@blahblahblah";
$subject = "Employer Registration Form";
$headers = "From: " . $_POST['emailAddress'];
$body = $_POST['contactPerson'];
$body .= $_POST['homePhone'];
$body .= $_POST['mobile'];
$body .= $_POST['fax'];
$body .= $_POST['bestTimeContact'];
$body .= $_POST['totalStaff'];
$body .= $_POST['kitchenStaff'];
$body .= $_POST['floorStaff'];
$body .= $_POST['staffTurnover'];
$body .= $_POST['comisChef'];
ini_set("sendmail_from", " enquiries@blahblahblah ");

How can I initiate a line break between each body element so as to make it easier to read once submitted?

Thanks in advance for any assistance.

11-30-2006, 12:40 PM
\n is the character code for a linebreak, so you'd use:


11-30-2006, 04:13 PM
Excellent, thank you very much – didn’t expect such a timely response.

I hope to be of assistance myself sometime, though given my knowledge…….