July 12th, 2013, 03:18 PM
Missing enters textfield
I have this form with a textarea. But when I store the text in the database, and retrieve it, the "enters" are gone. How can I fix this?
July 12th, 2013, 03:52 PM
They're not gone, they just don't appear as newlines in HTML. Try outputting with nl2br (do it after HTML-escaping).
July 12th, 2013, 04:26 PM
it works, thanks
July 16th, 2013, 09:00 AM
oh should I use htmlspecialchars before, or after nl2br
July 16th, 2013, 09:18 AM
Before, obviously. Just as requinix said. Otherwise, all the <br /> will appear literally in the text.
July 16th, 2013, 09:20 AM
Thanks I got now this, should be good:
Last edited by derplumo; July 16th, 2013 at 09:22 AM.