July 12th, 2013, 02: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, 02: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, 03:26 PM
it works, thanks
July 16th, 2013, 08:00 AM
oh should I use htmlspecialchars before, or after nl2br
July 16th, 2013, 08:18 AM
Before, obviously. Just as requinix said. Otherwise, all the <br /> will appear literally in the text.
July 16th, 2013, 08:20 AM
Thanks I got now this, should be good:
Last edited by derplumo; July 16th, 2013 at 08:22 AM.