spewn
Programmer
- May 7, 2001
- 1,034
I have a form that has a textarea. Users can type info into the textarea, and hit return when they need to create a new paragraph.
Then I have a perl script that pulls the info from textarea, stores in variable, then puts that variable in a mail script (using sendmail).
It works, but not exactly as it should.
If the user types in:
[textarea]
Here we have a story about a snake and a rabbit.
The rabbit runs to the snake.
The snake eats the rabbit.
[/textarea]
Once I capture that and put in sendmail script, the email shows the text as:
Here we have a story about a snake and a rabbit.
The rabbit runs to the snake.
The snake eats the rabbit.
As you can see, when I get the email, there are double returns where the user has pressed return.
I've tried escaping the textarea value, then unescaping the value when I put it in the email, but to no avail.
This is driving me crazy. I can store it in a database, and it stores correctly, but once it goes into the email, it comes to me double spaced.
Any ideas?
- g
Then I have a perl script that pulls the info from textarea, stores in variable, then puts that variable in a mail script (using sendmail).
It works, but not exactly as it should.
If the user types in:
[textarea]
Here we have a story about a snake and a rabbit.
The rabbit runs to the snake.
The snake eats the rabbit.
[/textarea]
Once I capture that and put in sendmail script, the email shows the text as:
Here we have a story about a snake and a rabbit.
The rabbit runs to the snake.
The snake eats the rabbit.
As you can see, when I get the email, there are double returns where the user has pressed return.
I've tried escaping the textarea value, then unescaping the value when I put it in the email, but to no avail.
This is driving me crazy. I can store it in a database, and it stores correctly, but once it goes into the email, it comes to me double spaced.
Any ideas?
- g