issue with formating forum posts
I built my forum from scratch using php and css. I have inserted many of the security protections for every posts that is submitted by a registered user. This issues I am having is when I test and insert a post on my own I am typing and adding in caridge returns but when my posts are displayed without any extra lines all inline with each other.
I am using mysqli_real_escape_string () on all my entries. Could that be the reason when it is retrieved from the database the spaces are removed? If so, how does all the forum software protect against XSS attacks but still keep the formating the user does?
Use nl2br() when outputting the content to HTML.
"Please give us a simple answer, so that we don't have to think, because if we think, we might find answers that don't fit the way we want the world to be."
~ Terry Pratchett in Nation
How to Ask Questions the Smart Way
(not affiliated with this site, but well worth reading)
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)