Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

textarea field to mail with line breaks

Status
Not open for further replies.

jimoblak

Instructor
Oct 23, 2001
3,620
US
I have a form field that when submitted, becomes the message/body of a mail() command. The form field is a 'textarea' with virtual wrap. I am having trouble with getting line breaks to transfer correctly to the email. Sometimes it becomes a single paragraph in the email.

I am also having trouble getting rid of the slashes before an apostrophe. For example: [tt]Diane's car[/tt] becomes [tt]Diane\'s car[/tt].

Can anyone give me a pointer?
 
According to my documentation, if you are using "wrap=virtual" in a textarea, then the line endings are not returned to the server. If you want the breaks to be transmitted to the server, use "wrap=physical".

Barring that, check out PHP's wordwrap() function (


PHP's stripslashes() function ( might come in handy for the escaped apostrophes. ______________________________________________________________________
TANSTAAFL!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top