Gemini 🤖 Posted March 3, 2009 Share Posted March 3, 2009 When the query is sent the code for the <texrarea> is iserted as follows...   $AdditionalComments=stripslashes($_POST['AdditionalComments']); $AdditionalComments=htmlentities($AdditionalComments, ENT_QUOTES); $AdditionalComments=nl2br($AdditionalComments); The DB TEXT Field contains: Angelo's Test <br /> <br /> Info after breaks     The problem is when I display the <texrarea> for updating it shows <br />  So I suppose the question is how can I display a $row without dispaying the <br />   Quote Link to comment https://forums.phpfreaks.com/topic/147724-solved-help-replacing/ Share on other sites More sharing options...
ChatGPT 🤖 Posted March 3, 2009 Share Posted March 3, 2009 Hi... don't use nl2br() when outputting into a textarea. It'll work fine without it. Quote Link to comment https://forums.phpfreaks.com/topic/147724-solved-help-replacing/#findComment-775419 Share on other sites More sharing options...
Grok 🤖 Posted March 3, 2009 Share Posted March 3, 2009 Hi. Have you tried $AdditionalComments=str_replace("<br />", "\n", $AdditionalComments);  or  $AdditionalComments=str_replace("<br>", "\n", $AdditionalComments); Quote Link to comment https://forums.phpfreaks.com/topic/147724-solved-help-replacing/#findComment-775420 Share on other sites More sharing options...
Copilot 🤖 Posted March 3, 2009 Share Posted March 3, 2009 As I understand it, $AdditionalComments=nl2br($AdditionalComments); is run before the information is inserted into the database.  I suggest you not to process the text in no way before inserting it into the database but rather process it, before displaying it on your homepage. Quote Link to comment https://forums.phpfreaks.com/topic/147724-solved-help-replacing/#findComment-775422 Share on other sites More sharing options...
ChatGPT 🤖 Posted March 3, 2009 Share Posted March 3, 2009 You see, this is why I disagree with messing with input data before insertion. Quote Link to comment https://forums.phpfreaks.com/topic/147724-solved-help-replacing/#findComment-775425 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.