graham23s Posted July 29, 2007 Share Posted July 29, 2007 Hi Guys, when i echo out text from mysql in a text area field it also echoes out the line breaks e.g <br /> it doesn't happen if i echo out anywhere else on the page, could i do a preg_replace to make all the line breaks echo NULL? echo '<br />Replying To (<a href="user_details.php?id='.$sender_id.'">'.$sender_name.'</a>)<br /><br /> <table with="500" border="1" bordercolor="#000000" cellspacing="0" cellpadding="5" /> <form action="reply_sent.php?id='.$sender_id.'" method="POST" /> <tr> <td>Subject:</td><td><input type="text" name="subject" size="52" value="Re: '.$subject.'"/></td> </tr> <tr> <td>Message:</td><td><textarea name="message" rows="10" cols="40" />------------ MESSAGE ------------'.$message.'------------ MESSAGE ------------</textarea></td> </tr> <td colspan="2" align="right" bgcolor="#004E98"/><input type="submit" name="submit" value="Send Message!" /> </td> </table></form><br />'; cheers guys Graham Link to comment https://forums.phpfreaks.com/topic/62317-echoing-php-in-a-textfield/ Share on other sites More sharing options...
Aureole Posted July 29, 2007 Share Posted July 29, 2007 nl2br()? Link to comment https://forums.phpfreaks.com/topic/62317-echoing-php-in-a-textfield/#findComment-310077 Share on other sites More sharing options...
graham23s Posted July 29, 2007 Author Share Posted July 29, 2007 Hi Mate, that works when i'm putting data into mysql all breaks in mysql show up as <br />, but when i retrieve the information it also echoes out the <br />'s Graham Link to comment https://forums.phpfreaks.com/topic/62317-echoing-php-in-a-textfield/#findComment-310174 Share on other sites More sharing options...
Aureole Posted July 30, 2007 Share Posted July 30, 2007 Sorry I didn't read your post properly before I posted that, I thought you were adding linebreaks and they weren't showing, sorry. Link to comment https://forums.phpfreaks.com/topic/62317-echoing-php-in-a-textfield/#findComment-311006 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.