shadiadiph Posted May 8, 2009 Share Posted May 8, 2009 I have been making a mail inbox but now i am on the reply to message section problem is getting the return message to display in text in the <texarea> I want when the user hits reply for the original message to appear in the reply textarea box problem is it keeps displaying with all the <br /> tags in place if i just print $message it displays fine like a message fine but when i try to put <textarea name="newmessage"><?=$message?></textarea> the message displays like this. Welcome<br/>to website.com thank you for joining our community<br/><br/> Please login to your account<br /><br />Your password is ******<br /><br/> any ideas i have been through the php manual the only thing i can seem to find are functions that add more <br /> tags and noe that turn the mesage back into readable text?? Link to comment https://forums.phpfreaks.com/topic/157382-solved-formatting-message-problem/ Share on other sites More sharing options...
Ken2k7 Posted May 8, 2009 Share Posted May 8, 2009 You don't need <BR />, you can just echo out $_POST['newmessage']; Link to comment https://forums.phpfreaks.com/topic/157382-solved-formatting-message-problem/#findComment-829634 Share on other sites More sharing options...
shadiadiph Posted May 8, 2009 Author Share Posted May 8, 2009 erm I am doing that from the user reading the message as <?=$message?> displays fine then adding it to a hidden fiield as name="message" value="<?=$message?>" and posting it back but then when i get the $message= $_POST["message"]; and then put <?=$message?> back into the next part it is full of <br/> I am not adding <br /> Link to comment https://forums.phpfreaks.com/topic/157382-solved-formatting-message-problem/#findComment-829638 Share on other sites More sharing options...
mattal999 Posted May 8, 2009 Share Posted May 8, 2009 Because it's in a textarea? If I remember correctly textboxes don't support HTML. May be wrong though... Link to comment https://forums.phpfreaks.com/topic/157382-solved-formatting-message-problem/#findComment-829668 Share on other sites More sharing options...
shadiadiph Posted May 8, 2009 Author Share Posted May 8, 2009 ok that is what i am thinking but if that is the case then how do they do it in these forums??? Here is another problem I am having is why is this displaying the message twice seems to be displaying the hidden input value too? I have looked at it 100 times seems right? <?php if ($action=="viewmessage") { ?> <table class="mailbox"> <form id="viewmessage" action="messages.php?fid=<?=$fid?>" method="post"> <tr><td><input type="hidden" name="message" value="<?=$message?>" /></td></tr> <tr><td class="boxhead"><input class="headbutton" type="submit" name="submitreply" value="Reply" /></td></tr> <tr><td class="viewhead">From: <?=$fromuser?></td></tr> <tr><td class="viewhead">Date: <?=$daterec?></td></tr> <tr><td class="viewhead">Subject: <?=$subject?></td></tr> <tr><td class="spacer"></td></tr> <tr><td class="messageview"><?=$message?></td></tr> <tr><td class="boxhead"><input class="headbutton" type="submit" name="submitreply" value="Reply" /></td></tr> </table> </form> <?php } ?> Link to comment https://forums.phpfreaks.com/topic/157382-solved-formatting-message-problem/#findComment-829674 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.