When I save textarea to my text file, it does not save correctly.
textarea as entered in the form.
line 1
line 2
line 3
saves as:
|line 1
line 2
line 3|
It's trying to save as it was entered but each line in the text file represents
a seperate record.
If I have the following fields:
$username
$notes (textarea)
$date
It will display in the text file as:
John Doe||03/09/06
Jane Doe||03/09/06
James Doe|line 1
line 2
line 3|03/09/06
So now when I list the first record (name) in the text file, I get:
John Doe
Jane Doe
James Doe
line 2
line 3
Help, newbie here wasted three days on this.
Doing the same on PHP 4 and PHP 5.
Saving Textarea to text file
Moderator: General Moderators
-
austellpgrammer
- Forum Newbie
- Posts: 1
- Joined: Sun Apr 09, 2006 3:08 pm
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
use addslashes(), or a similar function to convert the textarea into a single line string.