Page 1 of 1

Formatting submitted Data from a field

Posted: Sun Jan 11, 2009 10:15 am
by oscardog
So i've got somewhere, a textfield, where people can write asmuch as they want currently, i will put a limiter of 10,000 characters on though. Now if they put a new paragraph, when its then displayed, i want to display it exactly as they wrote it. It submits into a MySQL database, so say i write:

'My Name is Ashley

And Im 17

And i love this website'

I want it to appear like that, but it appears as :My Name is Ashley And Im 17 And i love this website.

Im assuming i need to add \n to signify a newline each time they hit enter, but when it submits how do i put those \n's in before it submits, and how can i tell where to put them?

Complex, i know, but any help?

Re: Formatting submitted Data from a field

Posted: Sun Jan 11, 2009 10:20 am
by Cirdan
If you are allowing them to use HTML, you could use something like FCK Editor to help format your users posts.But be careful, allowing all HTML is dangerous.

Re: Formatting submitted Data from a field

Posted: Sun Jan 11, 2009 2:31 pm
by oscardog
I am using a normal textfield... any ideas?