Click to See Complete Forum and Search --> : Contact Form - Placing Linkbreaks in a TextArea?


invisible777
11-13-2006, 11:59 AM
I have a simple contact form that sends to my email. I have a textarea for the Comments field, and I need it to insert a linebreak whenever the use hits enter in this textarea. Right now when I get the form in my email the text is just on one long line... anyone know how I can fix this?

NogDog
11-13-2006, 01:14 PM
If you're sending the email text as HTML, then use the nl2br() function.

invisible777
11-13-2006, 01:22 PM
Where would I insert that? Sorry not that familiar with PHP...

pcthug
11-13-2006, 04:53 PM
$comments = nl2br($_POST['comments']);