EchoFool Posted July 11, 2008 Share Posted July 11, 2008 I have a text area which, with the inputted text goes to an update query and adds it to a text field. Now this is what i put before it goes in: <?php $Start = stripslashes(mysql_real_escape_string($_POST['Start'])); //query here ?> Now the next page echos it: <?=nl2br(strip_tags($MissionInfo))?> For some unknown reason though, the structure is lost like new lines so it becomes one giant text. And it occasionally adds rnrn to my paragraphs for no reason... Example of block of text: Hello there ! Testing this sentence!Testing this sentence also!rnNow then, i hope this works.rnrn Observe the bold rnrn... why is that happening? Link to comment https://forums.phpfreaks.com/topic/114340-solved-my-script-inserts-quotrnrnquot-in-to-stringwhy/ Share on other sites More sharing options...
DarkWater Posted July 11, 2008 Share Posted July 11, 2008 If you stripslashes() AFTER you use mysql_real_escape_string(), you completely undo the effects of it. Link to comment https://forums.phpfreaks.com/topic/114340-solved-my-script-inserts-quotrnrnquot-in-to-stringwhy/#findComment-587978 Share on other sites More sharing options...
EchoFool Posted July 11, 2008 Author Share Posted July 11, 2008 So it should be: mysql_real_escape_string(stripslashes($_POST['Start'])); ? Link to comment https://forums.phpfreaks.com/topic/114340-solved-my-script-inserts-quotrnrnquot-in-to-stringwhy/#findComment-587981 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.