please i am trying to make the message show on newline as the customer types it, but i am getting /r/n
between each line and also trying to make the $body .= $_SESSION['username'];
appear on a separate line i have tried to use this example to solve but has not been successful the code is below
<?php require_once("include/session.php");?>
<?php require_once("include/dataconnect.php");?>
<?php require_once("include/functions.php");?>
<?php include("include/mheader.php");?>
<?php
$submit = $_POST['Notify'];
$message = mysql_real_escape_string(htmlentities(strip_tags($_POST['message'])));
//echo "$message";
//die();
if('POST' === $_SERVER['REQUEST_METHOD'])
{
if (isset($message))
{
//Get Email Address
$emails = mysql_query("SELECT email FROM reusers WHERE username = '{$_SESSION['username']}'")or die(mysql_error());
//$emails = mysql_query("SELECT reusers.email FROM reusers INNER JOIN repplac ON reusers.username = repplac.Uname AND reusers.username = '".$_SESSION['username']."'")or die(mysql_error());
$results = (mysql_fetch_assoc($emails)) or die(mysql_error());
$email= $results['email'];
//echo "$email";
//die();
if(mysql_num_rows($emails) == 0){
exit("No email addresses found for user '{$_SESSION['username']}'");
}
$email = mysql_result($emails, 0);
//echo "$email";
//die();
$body = $_SESSION['username']. "<br>"
. nl2br($_POST['message']);
$to = $email;
$subject = "copy of your notification";
$headers = "From: noti@r.co.uk
";
$headers .= 'MIME-Version: 1.0' . "
";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "
";
$headers .= 'Bcc:noti@r.co.uk' . "
";
mail($to,$subject,$body,$headers);
}
}
?>
<p>
<form action='notification.php' method='Post' class='rl'>
<div>
<label for='message' class='fixedwidth'>Message</label>
<textarea name="message" rows ="7" cols="40" id="message"></textarea>
</div>
<div class='buttonarea'>
<p>
<input type='submit' name='notify' value='Notify'>
</p>
</div>
</form>
</p>
<?php include("include/footer.php");?>