LOUDMOUTH Posted April 6, 2009 Share Posted April 6, 2009 I have this as my reply message code it inserts the dashes as a line break to separate the Original message from the reply. How can I get rid of the dashes and just have 2 break lines instead? \n ------------------------------------------------------------------------------------------------------ \n <td width='85%' colspan='3'><textarea name='msgtext' cols='53' rows='7'><?php echo ($_GET['reply'] != "") ? " \n ------------------------------------------------------------------------------------------------------ \n ".$worked2['msgtext'] : ""; ?></textarea></td> Quote Link to comment https://forums.phpfreaks.com/topic/152832-solved-need-help/ Share on other sites More sharing options...
iarp Posted April 6, 2009 Share Posted April 6, 2009 <hr> might be what your after. Edit: i did misread that, the answers in phil88's reply. Quote Link to comment https://forums.phpfreaks.com/topic/152832-solved-need-help/#findComment-802582 Share on other sites More sharing options...
LOUDMOUTH Posted April 6, 2009 Author Share Posted April 6, 2009 Where would I add the <hr > Quote Link to comment https://forums.phpfreaks.com/topic/152832-solved-need-help/#findComment-802585 Share on other sites More sharing options...
phil88 Posted April 6, 2009 Share Posted April 6, 2009 I think iarp may have misread your post, I don't think <hr> is what you need (unless I've misread your post ) Instead of; <td width='85%' colspan='3'><textarea name='msgtext' cols='53' rows='7'><?php echo ($_GET['reply'] != "") ? " \n ------------------------------------------------------------------------------------------------------ \n ".$worked2['msgtext'] : ""; ?></textarea></td> Have: <td width='85%' colspan='3'><textarea name='msgtext' cols='53' rows='7'><?php echo ($_GET['reply'] != "") ? "<br><br>".$worked2['msgtext'] : ""; ?></textarea></td> Quote Link to comment https://forums.phpfreaks.com/topic/152832-solved-need-help/#findComment-802590 Share on other sites More sharing options...
LOUDMOUTH Posted April 6, 2009 Author Share Posted April 6, 2009 It just inserts <br><br> into the message text area <td width='85%' colspan='3'><textarea name='msgtext' cols='53' rows='7'><?php echo ($_GET['reply'] != "") ? "<br><br>".$worked2['msgtext'] : ""; ?></textarea></td> Quote Link to comment https://forums.phpfreaks.com/topic/152832-solved-need-help/#findComment-802595 Share on other sites More sharing options...
iarp Posted April 6, 2009 Share Posted April 6, 2009 shouldn't \n\n work? <br> won't be processed in <textarea> Quote Link to comment https://forums.phpfreaks.com/topic/152832-solved-need-help/#findComment-802597 Share on other sites More sharing options...
LOUDMOUTH Posted April 6, 2009 Author Share Posted April 6, 2009 same thing with \n\n still puts any <code> into the text area :s Quote Link to comment https://forums.phpfreaks.com/topic/152832-solved-need-help/#findComment-802600 Share on other sites More sharing options...
premiso Posted April 6, 2009 Share Posted April 6, 2009 <td width='85%' colspan='3'><textarea name='msgtext' cols='53' rows='7'><?php echo ($_GET['reply'] != "") ? "\r\n \r\n".$worked2['msgtext'] : ""; ?></textarea></td> Give that a try and see what comes of it. (Granted \n\n should have worked unless you are not making it clear on exactly what you want). Quote Link to comment https://forums.phpfreaks.com/topic/152832-solved-need-help/#findComment-802606 Share on other sites More sharing options...
LOUDMOUTH Posted April 6, 2009 Author Share Posted April 6, 2009 Here is what I mean. in the first image it shows you the dashes it enters into the text area. in the second is the view of a reply and as you can see it enters those dashes, i just want it to be a blank space in between the message and reply Quote Link to comment https://forums.phpfreaks.com/topic/152832-solved-need-help/#findComment-802620 Share on other sites More sharing options...
premiso Posted April 6, 2009 Share Posted April 6, 2009 On displaying it in the 2nd page us nl2br on the data. That will solve the issue. As such, what you have posted really does not have much to do with how/where the data is displayed. That would have been better code to post. Quote Link to comment https://forums.phpfreaks.com/topic/152832-solved-need-help/#findComment-802624 Share on other sites More sharing options...
LOUDMOUTH Posted April 6, 2009 Author Share Posted April 6, 2009 Here is the View message page, where would I add the nl2br code? <? include 'header.php'; ?> <tr><td class="contenthead">Mailbox</td></tr> <tr><td class="contentcontent"> <table width='100%'> <? $result = mysql_query("SELECT * from `pms` WHERE `id`='".$_GET['id']."'"); $row = mysql_fetch_array($result); $from_user_class = new User($row['from']); if ($_GET['id'] != ""){ if (strtoupper($row['to']) == strtoupper($user_class->username)) { echo " <tr> <td width='15%'>Subject:</td> <td width='45%'>".$row['subject']."</td> <td width='15%'>Sender:</td> <td width='25%'>".$from_user_class->formattedname."</td> </tr> <tr> <td>Recieved:</td> <td colspan='3'>".date(F." ".d.", ".Y." ".g.":".i.":".sa,$row['timesent'])."</td> </tr> <tr> <td colspan='3' class='textm'><b>Message</b>:<br><br>".wordwrap($row['msgtext'], 100, "\n", 1)." </td> </tr> <tr> <td colspan='4' align='center'><a href='pms.php?delete=".$row['id']."'>Delete</a> | <a href='pms.php?reply=".$row['id']."'>Reply</a></td> </tr> <tr> <td colspan='4' align='center'><a href='pms.php'>Back To Mailbox</a></td> </tr> "; $result2 = mysql_query("UPDATE `pms` SET `viewed` = '2' WHERE `id`='".$row['id']."'"); } } ?> </table> </td></tr> <? include 'footer.php'; ?> Quote Link to comment https://forums.phpfreaks.com/topic/152832-solved-need-help/#findComment-802629 Share on other sites More sharing options...
premiso Posted April 6, 2009 Share Posted April 6, 2009 <td colspan='3' class='textm'><b>Message</b>:<br><br>".wordwrap(nl2br($row['msgtext']), 100, "\n", 1)." Would be where you would add it. Quote Link to comment https://forums.phpfreaks.com/topic/152832-solved-need-help/#findComment-802640 Share on other sites More sharing options...
LOUDMOUTH Posted April 6, 2009 Author Share Posted April 6, 2009 That worked perfectly Thank you guys! Quote Link to comment https://forums.phpfreaks.com/topic/152832-solved-need-help/#findComment-802676 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.