phpretard 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 /> Link to comment https://forums.phpfreaks.com/topic/147724-solved-help-replacing/ Share on other sites More sharing options...
waynew 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. Link to comment https://forums.phpfreaks.com/topic/147724-solved-help-replacing/#findComment-775419 Share on other sites More sharing options...
PcGeniusProductions 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); Link to comment https://forums.phpfreaks.com/topic/147724-solved-help-replacing/#findComment-775420 Share on other sites More sharing options...
phant0m 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. Link to comment https://forums.phpfreaks.com/topic/147724-solved-help-replacing/#findComment-775422 Share on other sites More sharing options...
waynew Posted March 3, 2009 Share Posted March 3, 2009 You see, this is why I disagree with messing with input data before insertion. Link to comment https://forums.phpfreaks.com/topic/147724-solved-help-replacing/#findComment-775425 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.