monkeytooth Posted August 29, 2008 Share Posted August 29, 2008 what are these called?... \n \r \... and where can I find a list of similar? I have a multi line textarea that is user submitted, and then displayed on the page, as well as stored in a DB.. but I am wanting to replace certain things like the above, and quotes and double quotes, slashes etc.. from being stored physically I am replacing them with forum tags in a sence.. So this is a 3 part question.. the 2 I have asked thus far.. and does anyone have specifics that they would do a similar concept of swapping for when it comes to DB storage and just general scripting to prevent scripts from breaking upon displaying or using the stored info, as well as to help prevent malicious use.. Link to comment https://forums.phpfreaks.com/topic/121922-lame-question-but-help-me-anyway/ Share on other sites More sharing options...
The Little Guy Posted August 29, 2008 Share Posted August 29, 2008 \n = new line \r = carriage return Link to comment https://forums.phpfreaks.com/topic/121922-lame-question-but-help-me-anyway/#findComment-629205 Share on other sites More sharing options...
Fadion Posted August 29, 2008 Share Posted August 29, 2008 Not that I understand your question completely but: \n = newline \r = carriage return \t = tab To escape characters which can cause sql injections, you must use mysql_real_escape_string(). To prevent input from causing XSS attacks you must use htmlentities(). If there is anything you are asking for, please ask it again clearly as right now i'm confused Link to comment https://forums.phpfreaks.com/topic/121922-lame-question-but-help-me-anyway/#findComment-629207 Share on other sites More sharing options...
monkeytooth Posted August 29, 2008 Author Share Posted August 29, 2008 its not so much for the storage aspect in SQL that the question came to be.. its more so what I am doing with it prior and after inserting it in.. the htmlentities is something im implimenting, and the mysql_real_escape_string() is something im gonna read up on in a little bit.. the question is mostly cause it goes from form input to html output back to form input for different reasons pending on what the use is at the moment.. and I have ran into some problems with going back and forth like that in the past due to some things like \n\r not transitioning to well back and forth, so Im trying to catch it and swap it with the HTML equivilant, or catch the HTML equivilant and swap it to the textarea equivilant so it displays right between the output type determined, the storing in the database actually has nothing to do with this other then initial background info about what im tempting to do kinda.. but in hien site not really.. Link to comment https://forums.phpfreaks.com/topic/121922-lame-question-but-help-me-anyway/#findComment-629215 Share on other sites More sharing options...
monkeytooth Posted August 29, 2008 Author Share Posted August 29, 2008 although is there any other things outside of \n \r \t that I should look for.. or better yet is there a master list or list of such out there that anyone knows of.. or whats the term for those, not the deffinition of each but the term one uses to refer to them generally Link to comment https://forums.phpfreaks.com/topic/121922-lame-question-but-help-me-anyway/#findComment-629217 Share on other sites More sharing options...
DarkWater Posted August 29, 2008 Share Posted August 29, 2008 They're called non-printing characters. The others ones are \a, \e, \f, and \v, but you won't really get those in a form textarea. Link to comment https://forums.phpfreaks.com/topic/121922-lame-question-but-help-me-anyway/#findComment-629228 Share on other sites More sharing options...
Fadion Posted August 29, 2008 Share Posted August 29, 2008 Oh and probably it may come handy, nl2br() will convert newlines to html line breaks. Link to comment https://forums.phpfreaks.com/topic/121922-lame-question-but-help-me-anyway/#findComment-629230 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.