Jump to content

Lame question but help me anyway?


monkeytooth

Recommended Posts

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

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 :)

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..

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.