textarea - newline in text area in html form doesn't remain once posted -


i'm having textarea in contact form php mail function. in php mail have set header html.

but if user types this

line1.... line2.... 

i'm getting in mail this.

line1....line2.... 

what reason?

update: text area simple this.

<textarea id ="msg" name="message" cols="" rows="5" class="msg">message</textarea> 

its posted script jquery ajax function

<?php $sub =  "message posted"; $email = "some@somewhere.com"; $message = "<b>message :</b><br/>" . $_request["msg"]; $message = wordwrap($message, 70);  $headers  = 'mime-version: 1.0' . "\r\n"; $headers .= 'content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers .= 'from: ifthi@ifthi.com' . "\r\n" .     'reply-to: '. $_request["email"] . "\r\n" .     'x-mailer: php/' . phpversion();   // send mail($email, $sub, $message,$headers); ?> 

but when getting in email in single line. if write in 2 line , submit.

if set mail html should replace line breaks html
tags.

i think php function need is: string nl2br ( string $string [, bool $is_xhtml = true ] )


Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

html - Instapaper-like algorithm -

c# - How to execute a particular part of code asynchronously in a class -