Welcome to WebmasterWorld Guest from 54.196.231.129

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

Preserve format of data send through textarea

     
9:43 pm on Sep 13, 2009 (gmt 0)

Junior Member

10+ Year Member

joined:Sept 26, 2005
posts:90
votes: 0


Hello,
I need to know if there is a way of preserving the exact format of data that is send through a textarea. The data is send via $_POST variable from the submit page, and is written in a file. However, when I see the output file, I get:

MKKTAIAIAVALAGFATVAQAAPKDNTWYTGAKLGWSQYHDTGFINNNGPTHENQLGAGA

FGGYQVNPYVGFEMGYDWLGRMPYKGSVENGAYKAQGVQLTAKLGYPITDDLDIYTRLGG

MVWRADTKSNVYGKNHDTGVSPVFAGGVEYAITPEIATRLEYQWTNNIGDAHTIGTRPDN

GMLSLGVSYRFGQGEAAPVVAPAPAPAPEVQTKHFTLKSDVLFNFNKATLKPEGQAALDQ

LYSQLSNLDPKDGSVVVLGYTDRIGSDAYNQGLSERRAQSVVDYLISKGIPADKISARGM

GESNPVTGNTCDNVKQRAALIDCLAPDRRVEIEVKGIKDVVTQPQA

instead of

MKKTAIAIAVALAGFATVAQAAPKDNTWYTGAKLGWSQYHDTGFINNNGPTHENQLGAGA
FGGYQVNPYVGFEMGYDWLGRMPYKGSVENGAYKAQGVQLTAKLGYPITDDLDIYTRLGG
MVWRADTKSNVYGKNHDTGVSPVFAGGVEYAITPEIATRLEYQWTNNIGDAHTIGTRPDN
GMLSLGVSYRFGQGEAAPVVAPAPAPAPEVQTKHFTLKSDVLFNFNKATLKPEGQAALDQ
LYSQLSNLDPKDGSVVVLGYTDRIGSDAYNQGLSERRAQSVVDYLISKGIPADKISARGM
GESNPVTGNTCDNVKQRAALIDCLAPDRRVEIEVKGIKDVVTQPQA

Should I add something in my php submit page in the textarea part or is it something I have to do with the data before I write it in the file?

Thank you

11:04 am on Sept 14, 2009 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Oct 15, 2004
posts:941
votes: 0


seems like there is an extra line break when you read/print your content.
Is it possible that you save your data using nl2br()?
Or that you read them with nl2br()?
If yes, remove it and see how this goes