PDA

View Full Version : Securing MySQL & More


zidian
08-06-2007, 06:57 PM
How do you make entries safe and be able to retrieve them in the correct format. I temporarily inserted the 'mysql_escape_string' function through every variable, but how would I go about changing that back to it's original format? Should I use a different function. If not, could some one help me or write me a custom function.

Also, how do you change '\n',' \r', and the troublesome '\n\r' into line breaks? I need somebody to help me or write me a custom function for this as well.

cr0wonline
08-06-2007, 08:53 PM
Use mysql_real_escape_string() to escape entries, then use stripslashes() and htmlentities() when retrieving information. As for the line breaks, use nl2br().