Creating line breaks in output?
Moderator: General Moderators
-
Lou Ghaddar
- Forum Newbie
- Posts: 9
- Joined: Tue Feb 17, 2004 12:33 pm
Creating line breaks in output?
I have made an email form in Flash that outputs to a PHP file to then be mailed to an email address. Everything works but the output in the email is all on one line. I would like to be able to make a line break so that each output would be on its own line.
The FLash form has seven fields that are all user input fields. (i.e. firstName, lastName, phone, altPhone, address, and commentBox.) I would like each one to appear in the email on it's own line.
The code is as follow:
<?php
$sendTo = "lou@selway.umt.edu";
$subject = "Design Turf Career Oppurtunities Reply";
$headers = "From: " . $_POST["firstName"]. "','".$_POST{"lastName"];
$headers .= "<" . $_POST["email"] .">\r\n";
$message = "First Name: " . $_POST["firstName"]. "','".$_POST["lastName"]. "','".$_POST["phone"]. "','".$_POST["altPhone"]. "','".$_POST["email"]. "','".$_POST["address"]. "','".$_POST["commentBox"];
mail($sendTo, $subject, $message, $headers);
?>
The FLash form has seven fields that are all user input fields. (i.e. firstName, lastName, phone, altPhone, address, and commentBox.) I would like each one to appear in the email on it's own line.
The code is as follow:
<?php
$sendTo = "lou@selway.umt.edu";
$subject = "Design Turf Career Oppurtunities Reply";
$headers = "From: " . $_POST["firstName"]. "','".$_POST{"lastName"];
$headers .= "<" . $_POST["email"] .">\r\n";
$message = "First Name: " . $_POST["firstName"]. "','".$_POST["lastName"]. "','".$_POST["phone"]. "','".$_POST["altPhone"]. "','".$_POST["email"]. "','".$_POST["address"]. "','".$_POST["commentBox"];
mail($sendTo, $subject, $message, $headers);
?>
-
Lou Ghaddar
- Forum Newbie
- Posts: 9
- Joined: Tue Feb 17, 2004 12:33 pm
I have tried it, and when I put it in the code no longer processes anything. Does it need to be in quotations, or brackets? And where exactly in the code should it be placed? I did this and it doesn't work.
$message = "Name: " . $_POST["firstName"]. " ". $_POST["lastName"].">\r\n" "Phone: ". $_POST["phone"];
$message = "Name: " . $_POST["firstName"]. " ". $_POST["lastName"].">\r\n" "Phone: ". $_POST["phone"];
-
Illusionist
- Forum Regular
- Posts: 903
- Joined: Mon Jan 12, 2004 9:32 pm
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
change toIllusionist wrote:$message = "Name: " . $_POST["firstName"]. " ". $_POST["lastName"].">\r\n" "Phone: ". $_POST["phone"];
change to:
$message = "Name: " . $_POST["firstName"]. " ". $_POST["lastName"].">\r\nPhone: ". $_POST["phone"];
Code: Select all
<?php
$message = "Name: " . $_POST['firstName']. " ". $_POST['lastName'].">\r\nPhone: ". $_POST['phone'];
?>-
Illusionist
- Forum Regular
- Posts: 903
- Joined: Mon Jan 12, 2004 9:32 pm
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
-
Illusionist
- Forum Regular
- Posts: 903
- Joined: Mon Jan 12, 2004 9:32 pm
-
Lou Ghaddar
- Forum Newbie
- Posts: 9
- Joined: Tue Feb 17, 2004 12:33 pm
-
Lou Ghaddar
- Forum Newbie
- Posts: 9
- Joined: Tue Feb 17, 2004 12:33 pm