Line break?
Posted on
16th Feb 2014 07:03 pm by
admin
Hi, I'm new to the forum and new to php. I'm not sure if I'm using the correct terminology so here it goes. I've created a page with multiple forms that when submitted get emailed to a certain address. When I receive the email it shows up as one big paragraph, but I would like it to appear similar to how the form looks. Any help would be greatly appreciated.
Thanks, Jason
<form method="post" form action="paytest.php">
<table width="541" border="1">
<tr>
<th width="115">Day</th>
<th width="73">Date</th>
<th width="73">Flat Rates</th>
<th width="78">Overnights</th>
<th width="77">Perdiem</th>
<th width="85">N #</th>
</tr>
<tr>
<td>SUNDAY</td>
<td><input type="text" size="10" maxlength="40" textarea name="date1"></td>
<td><input type="text" size="10" maxlength="40" textarea name="flatrate1"></td>
<td><input type="text" size="10" maxlength="40" textarea name="overnights1"></td>
<td><input type="text" size="10" maxlength="40" textarea name="perdiem1"></td>
<td><input type="text" size="10" maxlength="40" textarea name="tailnumber1"></td>
</tr>
<tr>
<td>MONDAY</td>
<td><input type="text" size="10" maxlength="40" name="date2"></td>
<td><input type="text" size="10" maxlength="40" name="flatrate2"></td>
<td><input type="text" size="10" maxlength="40" name="overnights2"></td>
<td><input type="text" size="10" maxlength="40" name="perdiem2"></td>
<td><input type="text" size="10" maxlength="40" name="tailnumber2"></td>
</tr>
<tr>
<td>TUESDAY</td>
<td><input type="text" size="10" maxlength="40" name="date3"></td>
<td><input type="text" size="10" maxlength="40" name="flatrate3"></td>
<td><input type="text" size="10" maxlength="40" name="overnights3"></td>
<td><input type="text" size="10" maxlength="40" name="perdiem3"></td>
<td><input type="text" size="10" maxlength="40" name="tailnumber3"></td>
</tr>
<tr>
<td>WEDNESDAY</td>
<td><input type="text" size="10" maxlength="40" name="date4"></td>
<td><input type="text" size="10" maxlength="40" name="flatrate4"></td>
<td><input type="text" size="10" maxlength="40" name="overnights4"></td>
<td><input type="text" size="10" maxlength="40" name="perdiem4"></td>
<td><input type="text" size="10" maxlength="40" name="tailnumber4"></td>
</tr>
<tr>
<td>THURSDAY</td>
<td><input type="text" size="10" maxlength="40" name="date5"></td>
<td><input type="text" size="10" maxlength="40" name="flatrate5"></td>
<td><input type="text" size="10" maxlength="40" name="overnights5"></td>
<td><input type="text" size="10" maxlength="40" name="perdiem5"></td>
<td><input type="text" size="10" maxlength="40" name="tailnumber5"></td>
</tr>
<tr>
<td>FRIDAY</td>
<td><input type="text" size="10" maxlength="40" name="date6"></td>
<td><input type="text" size="10" maxlength="40" name="flatrate6"></td>
<td><input type="text" size="10" maxlength="40" name="overnights6"></td>
<td><input type="text" size="10" maxlength="40" name="perdiem6"></td>
<td><input type="text" size="10" maxlength="40" name="tailnumber6"></td>
</tr>
<tr>
<td>SATURDAY</td>
<td><input type="text" size="10" maxlength="40" name="date7"></td>
<td><input type="text" size="10" maxlength="40" name="flatrate7"></td>
<td><input type="text" size="10" maxlength="40" name="overnights7"></td>
<td><input type="text" size="10" maxlength="40" name="perdiem7"></td>
<td><input type="text" size="10" maxlength="40" name="tailnumber7"></td>
</tr>
<tr>
<td>SUNDAY</td>
<td><input type="text" size="10" maxlength="40" name="date8"></td>
<td><input type="text" size="10" maxlength="40" name="flatrate8"></td>
<td><input type="text" size="10" maxlength="40" name="overnights8"></td>
<td><input type="text" size="10" maxlength="40" name="perdiem8"></td>
<td><input type="text" size="10" maxlength="40" name="tailnumber8"></td>
</tr>
<tr>
<td>MONDAY</td>
<td><input type="text" size="10" maxlength="40" name="date9"></td>
<td><input type="text" size="10" maxlength="40" name="flatrate9"></td>
<td><input type="text" size="10" maxlength="40" name="overnights9"></td>
<td><input type="text" size="10" maxlength="40" name="perdiem9"></td>
<td><input type="text" size="10" maxlength="40" name="tailnumber9"></td>
</tr>
<tr>
<td>TUESDAY</td>
<td><input type="text" size="10" maxlength="40" name="date10"></td>
<td><input type="text" size="10" maxlength="40" name="flatrate10"></td>
<td><input type="text" size="10" maxlength="40" name="overnights10"></td>
<td><input type="text" size="10" maxlength="40" name="perdiem10"></td>
<td><input type="text" size="10" maxlength="40" name="tailnumber10"></td>
</tr>
<tr>
<td>WEDNESDAY</td>
<td><input type="text" size="10" maxlength="40" name="date11"></td>
<td><input type="text" size="10" maxlength="40" name="flatrate11"></td>
<td><input type="text" size="10" maxlength="40" name="overnights11"></td>
<td><input type="text" size="10" maxlength="40" name="perdiem11"></td>
<td><input type="text" size="10" maxlength="40" name="tailnumber11"></td>
</tr>
<tr>
<td>THURSDAY</td>
<td><input type="text" size="10" maxlength="40" name="date12"></td>
<td><input type="text" size="10" maxlength="40" name="flatrate12"></td>
<td><input type="text" size="10" maxlength="40" name="overnights12"></td>
<td><input type="text" size="10" maxlength="40" name="perdiem12"></td>
<td><input type="text" size="10" maxlength="40" name="tailnumber12"></td>
</tr>
<tr>
<td>FRIDAY</td>
<td><input type="text" size="10" maxlength="40" name="date13"></td>
<td><input type="text" size="10" maxlength="40" name="flatrate13"></td>
<td><input type="text" size="10" maxlength="40" name="overnights13"></td>
<td><input type="text" size="10" maxlength="40" name="perdiem13"></td>
<td><input type="text" size="10" maxlength="40" name="tailnumber13"></td>
</tr>
<tr>
<td>SATURDAY</td>
<td><input type="text" size="10" maxlength="40" name="date14"></td>
<td><input type="text" size="10" maxlength="40" name="flatrate14"></td>
<td><input type="text" size="10" maxlength="40" name="overnights14"></td>
<td><input type="text" size="10" maxlength="40" name="perdiem14"></td>
<td><input type="text" size="10" maxlength="40" name="tailnumber14"></td>
</tr>
</table>
<input type="submit" value="Send"> <br />
</form>
paytest.php
<?php
$to = "test@test.com" ;
$subject = "paysheet" ;
$text.='date:'.$_REQUEST["date1"] ;
$text.='flat rate:'.$_REQUEST["flatrate1"] ;
$text.='over nights:'.$_REQUEST["overnights1"] ;
$text.='perdiem:'.$_REQUEST["perdiem1"] ;
$text.='tail number:'.$_REQUEST["tailnumber1"] ;
$text.='date:'.$_REQUEST["date2"] ;
$text.='flat rate:'.$_REQUEST["flatrate2"]. "
" ;
$text.='over nights:'.$_REQUEST["overnights2"] ;
$text.='perdiem:'.$_REQUEST["perdiem2"] ;
$text.='tail number:'.$_REQUEST["tailnumber2"] ;
$text.='date:'.$_REQUEST["date3"] ;
$text.='flat rate:'.$_REQUEST["flatrate3"] ;
$text.='over nights:'.$_REQUEST["overnights3"] ;
$text.='perdiem:'.$_REQUEST["perdiem3"] ;
$text.='tail number:'.$_REQUEST["tailnumber3"] ;
$text.='date:'.$_REQUEST["date4"] ;
$text.='flat rate:'.$_REQUEST["flatrate4"] ;
$text.='over nights:'.$_REQUEST["overnights4"] ;
$text.='perdiem:'.$_REQUEST["perdiem4"] ;
$text.='tail number:'.$_REQUEST["tailnumber4"] ;
$text.='date:'.$_REQUEST["date5"] ;
$text.='flat rate:'.$_REQUEST["flatrate5"] ;
$text.='over nights:'.$_REQUEST["overnights5"] ;
$text.='perdiem:'.$_REQUEST["perdiem5"] ;
$text.='tail number:'.$_REQUEST["tailnumber5"] ;
$text.='date:'.$_REQUEST["date6"] ;
$text.='flat rate:'.$_REQUEST["flatrate6"] ;
$text.='over nights:'.$_REQUEST["overnights6"] ;
$text.='perdiem:'.$_REQUEST["perdiem6"] ;
$text.='tail number:'.$_REQUEST["tailnumber6"] ;
$text.='date:'.$_REQUEST["date7"] ;
$text.='flat rate:'.$_REQUEST["flatrate7"] ;
$text.='over nights:'.$_REQUEST["overnights7"] ;
$text.='perdiem:'.$_REQUEST["perdiem7"] ;
$text.='tail number:'.$_REQUEST["tailnumber7"] ;
$text.='date:'.$_REQUEST["date8"] ;
$text.='flat rate:'.$_REQUEST["flatrate8"] ;
$text.='over nights:'.$_REQUEST["overnights8"] ;
$text.='perdiem:'.$_REQUEST["perdiem8"] ;
$text.='tail number:'.$_REQUEST["tailnumber8"] ;
$text.='date:'.$_REQUEST["date9"] ;
$text.='flat rate:'.$_REQUEST["flatrate9"] ;
$text.='over nights:'.$_REQUEST["overnights9"] ;
$text.='perdiem:'.$_REQUEST["perdiem9"] ;
$text.='tail number:'.$_REQUEST["tailnumber9"] ;
$text.='date:'.$_REQUEST["date10"] ;
$text.='flat rate:'.$_REQUEST["flatrate10"] ;
$text.='over nights:'.$_REQUEST["overnights10"] ;
$text.='perdiem:'.$_REQUEST["perdiem10"] ;
$text.='tail number:'.$_REQUEST["tailnumber10"] ;
$text.='date:'.$_REQUEST["date11"] ;
$text.='flat rate:'.$_REQUEST["flatrate11"] ;
$text.='over nights:'.$_REQUEST["overnights11"] ;
$text.='perdiem:'.$_REQUEST["perdiem11"] ;
$text.='tail number:'.$_REQUEST["tailnumber11"] ;
$text.='date:'.$_REQUEST["date12"] ;
$text.='flat rate:'.$_REQUEST["flatrate12"] ;
$text.='over nights:'.$_REQUEST["overnights12"] ;
$text.='perdiem:'.$_REQUEST["perdiem12"] ;
$text.='tail number:'.$_REQUEST["tailnumber12"] ;
$text.='date:'.$_REQUEST["date13"] ;
$text.='flat rate:'.$_REQUEST["flatrate13"] ;
$text.='over nights:'.$_REQUEST["overnights13"] ;
$text.='perdiem:'.$_REQUEST["perdiem13"] ;
$text.='tail number:'.$_REQUEST["tailnumber13"] ;
$text.='date:'.$_REQUEST["date14"] ;
$text.='flat rate:'.$_REQUEST["flatrate14"] ;
$text.='over nights:'.$_REQUEST["overnights14"] ;
$text.='perdiem:'.$_REQUEST["perdiem14"] ;
$text.='tail number:'.$_REQUEST["tailnumber14"] ;
$header = "from: Jason Smith" ;
$sent = mail($to, $subject, $text, $headers) ;
if($sent)
{print "Your pay sheet was sent successfully"; }
else
{print "We encountered an error sending your mail"; }
?>
No comments posted yet
Your Answer:
Login to answer
262
39
Other forums
Coefficient of a Restitution Hints
Hello. I was wondering if anyone can give me hints on how to write this program...
The coeffi
Cannot Connect to Database
I am writing an application to do annual reviews. I cannot get my script to work. Whenever it runs I
problem in program for counting no of chars using pointers
Hi all, I was trying to make a program which counts number of chars in a string using concpt of poin
Help with page encoding issue and weird characters
I'm trying to write a screen scraper and when I pull out the lines of the html file that I'm interes
JSON SORT WITH PHP
I have two products that I want to sort by say "Id:17, value: xxx" using php
The page w
Dynamic Data + Sql Server 2005 Enterprise?
Hi! I have just started to learn ASP.NET, and it looks like it is quite a lot to learn. Im not reall
GET vs SUBMIT Button to show sections on one index.php page?
Just curious if one of these ways is better (i.e. more efficient) than the other.
I have a
IP question
ive got 2 ip addresses both global from same user how would i detect if they are local to each other
C problem struct and string
Hi guys,
This is my first post and I'm hoping the experts here can help me solve my problem.<
Echo multiple lines of html code
Hi guys,
I would like to know if there is a way to echo multiple lines of html codes.