PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
828tuners
Forum Newbie
Posts: 5 Joined: Mon Jun 14, 2010 6:11 am
Post
by 828tuners » Mon Jun 14, 2010 6:14 am
i have wrote a php form for my business, it's an estimate with name, number, make/model of vehicle, and message. it emails the form to me, but what i'm getting is the number,make, and message in 1 line with no spaces. what i want is it to be on seperate lines. can someone look at this and tell me what's wrong
http://customcreationz.atbh.us/estimate.html
Code: Select all
<?php
$name = $_REQUEST['name'] ;
$message1 = $_REQUEST['message1'] ;
$message2 = $_REQUEST['message2'] ;
$message = $_REQUEST['message'] ;
mail( "customcreationz@charter.net", "Estimate Form",
$message1. $message2. $message, "From: $name" );
header( "Location: http://www.customcreationz.atbh.us/thanks.html" );
?>
internet-solution
Forum Contributor
Posts: 220 Joined: Thu May 27, 2010 6:27 am
Location: UK
Post
by internet-solution » Mon Jun 14, 2010 7:31 am
Add EOL between your variables:
Code: Select all
<?php
$name = $_REQUEST['name'] ;
$message1 = $_REQUEST['message1'] ;
$message2 = $_REQUEST['message2'] ;
$message = $_REQUEST['message'] ;
$mailMessage=$message1."\r\n".$message2."\r\n".$message;
mail( "customcreationz@charter.net", "Estimate Form",
$mailMessage, "From: $name" );
header( "Location: http://www.customcreationz.atbh.us/thanks.html" );
?>
828tuners
Forum Newbie
Posts: 5 Joined: Mon Jun 14, 2010 6:11 am
Post
by 828tuners » Mon Jun 14, 2010 4:36 pm
thanks i'll give this a try....what does EOL stand for?
828tuners
Forum Newbie
Posts: 5 Joined: Mon Jun 14, 2010 6:11 am
Post
by 828tuners » Mon Jun 14, 2010 4:41 pm
works like a chram thanks alot!!!!!!!!!!!!!!
internet-solution
Forum Contributor
Posts: 220 Joined: Thu May 27, 2010 6:27 am
Location: UK
Post
by internet-solution » Tue Jun 15, 2010 5:34 am
828tuners wrote: thanks i'll give this a try....what does EOL stand for?
EOL - end of line. In different contexts it will be different. In the case of mail messages its "\r\n".