newbie with question

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

Post Reply
828tuners
Forum Newbie
Posts: 5
Joined: Mon Jun 14, 2010 6:11 am

newbie with question

Post by 828tuners »

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

Re: newbie with question

Post by internet-solution »

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

Re: newbie with question

Post by 828tuners »

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

Re: newbie with question

Post by 828tuners »

works like a chram thanks alot!!!!!!!!!!!!!! :drunk:
internet-solution
Forum Contributor
Posts: 220
Joined: Thu May 27, 2010 6:27 am
Location: UK

Re: newbie with question

Post by internet-solution »

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".
Post Reply