Web Hosting Talk







View Full Version : PHP / Java Form Problem


rapture9
04-13-2005, 03:23 PM
i want to make it so when you skip a line on a form in a textbox, it will save in the database as a skipped line, so when it displays the info on a page, it has the skipped line.

like if i did this:

text

text 2

it will show up like that instead of
texttext 2

thanks in advance.

=-D
04-14-2005, 12:25 AM
when you save it into the database, use the function nl2br()

http://php.net/nl2br

rapture9
04-14-2005, 03:14 PM
Originally posted by =-D
when you save it into the database, use the function nl2br()

http://php.net/nl2br
thanks, but it didnt work... it won't return the skipped line that is in a textarea... i also tried all the other examples, none of them worked..

=-D
04-14-2005, 05:08 PM
if u want to redit, then convert the br's back to bl. use br2nl()

http://php.net/br2nl

Burhan
04-14-2005, 05:08 PM
You need to save it as it is, then when displaying it, use nl2br();

Make sure you are stripping slashes, because nl2br() will not replace \/n