Hey,
I have a contact form, and in there i have a <textarea> for their message.
When the form is submitted, the multiple lines turn into one line (even with the return key pressed).
contactform.html
<form action="sendmail.php" method="POST">
<textarea name="message" cols="50" rows="10" class="form"></textarea>
(There is more to it, but that's irrelevant)
sendmail.php
<?
header("Refresh: 1;URL=index.php");
$first_name=$_POST['first_name'];
$last_name=$_POST['last_name'];
$mail_from=$_POST['email'];
$message=$_POST['message'];
$mail_to="my@email.address";
$mail_subject="Form";
$headers = "MIME-Version: 1.0\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\n";
$headers .= "X-Priority: 3\n";
$headers .= "X-MSMail-Priority: Normal\n";
$headers .= "X-Mailer: php\n";
$headers .= "From:".$first_name." ".$last_name." (".$mail_from.")\r\n\r\n";
$mail_body = "<p>".$message."</p>";
$mail_body .= "<p>".$first_name." ".$last_name."</p>";
if (mail($mail_to,$mail_subject,$mail_body,$headers))
{
print "Mail Sent. Redirecting";
print "<br>".$message;
}
else {
print "failed";
}
?>
Is there a way around this, or not?