Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using $POST Variables with Spaces [duplicate]

I am using a PHP page to construct an email. Part of the email text is provided by $POST variables from an ealier page. Some of the variables contain spaces, which is causing the strings to truncate to a single word in my email. Any syntax ideas on how to get the whole string into the text of my email? ' . $_POST['VariableName'] . ' is obviously not working.

$message = '
<html>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>EuroClassic Transfer Notice</title>
</HEAD>

<body bgcolor="#F5EEDB">

<TABLE ID=hor-minimalist-b SUMMARY=EuroClassic Customer>
<THEAD>
<TR>
<TH colspan=4 scope=col>Shipping Logistics:</th>
</TR>
</THEAD>
<TBODY>

<TR>
<TD>Shipping From: </TD>
<TD><INPUT type=text size=35 name=from value=' . $_POST['from'] . '></TD>
<TD>Shipping To: </TD>
<TD><INPUT type=text size=35 name=ToLocation value=' . $_POST['ToLocation'] . '></TD>
</TR>
<TR>
<TD>PO Number: </TD>
<TD><INPUT type=text size=20 name=PO value=' . $_POST['PO'] . '></TD>
<TD>Address: </TD>
<TD><INPUT type=text size=35 name=address value=' . $_POST['address'] . '></TD>
</TR>
<TR>
<TD>Ship Date: </TD>
<TD><INPUT type=text size=20 name=ShipDate value=' . $_POST['ShipDate'] . '></TD>
<TD>City/State/ZIP: </TD>
<TD><INPUT type=text size=35 name=city value=' . $_POST['city'] . '></TD>
</TR>
<TR>
<TD>Arrival Date: </TD>
<TD><INPUT type=text size=20 name=ArrivalDate value=' . $_POST['ArrivalDate'] . '></TD>
<TD>Freight: </TD>
<TD><INPUT type=text size=20 name=cost value=' . $_POST['cost'] . '></TD>
</TR>
</TBODY>
</TABLE>

</div>
</body>
</html>
';
like image 603
Sterve Avatar asked Sep 23 '26 04:09

Sterve


1 Answers

Just put quotes around the attribute values.

like image 181
Explosion Pills Avatar answered Sep 24 '26 20:09

Explosion Pills



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!