[solved]form posting textarea problem

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
dharprog
Forum Contributor
Posts: 126
Joined: Fri Oct 27, 2006 12:20 am

[solved]form posting textarea problem

Post by dharprog »

Hi

I'm using a textarea tag in a form and passing the values and retrieving them in other php page with post method.

My problem is whatever i type in the textarea is just appending all the lines and just printing like this "Hi
House is for ready to occupy. COntact 3234232 thank you. "

But what i want is i would like to get it as line by line how can i do it in our php?

Line by line means:
-------------------------
Hi
House is for ready to occupy.
COntact 3234232,
thank you.

I'm just entering the lines as it is above in the textarea box.

Anybody Please kindly help me out from this.

Thank you.
Last edited by dharprog on Mon May 21, 2007 8:30 am, edited 1 time in total.
blackbeard
Forum Contributor
Posts: 123
Joined: Thu Aug 03, 2006 6:20 pm

Post by blackbeard »

If you're just trying to display the contents of the text area, you'll either have to wrap the contents in a <pre> tag, or you can use the nl2br function to convert newlines into <br />

The newlines are there, but browers need to be told what do do with them.
Post Reply