I am having some kind of guestbook, but when you are entering a text in an textarea and you give a enter je get an empty row in the textarea, but when you write it then to the database, the enter isn't enylonger ther
I just plases all of the text behind just as one blok not with seperated enters. How can I do this? A friend of mine told me to use special html characters, but how can I put them automatic in ther?
Greathings Skywalker
html special characters???
Moderator: General Moderators
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK
Use nl2br() when you output the data. The newlines are not being lost when they go into the database, they are instead being stored as new line characters (\n), by using nl2br() on the text before you output it to the page you get an HTML line break (<br />) next to each newline character. This means that the text will look on the page as it does in the text area.
Mac
Mac
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK