text area info...

A

Anonymous

Guest
Hi all,
how can I insert details from a text area into a database with line breaks etc inserted without anyone having to type "<br>"?

Any help would be greatly appreciated.

Best Regards,
Andrew
 
hi

You can do this thing by just using a single function before the final insertion of text area value into the database.

i.e.

Text_area_variable_name=nl2br(Text_area_variable_name)

I hope this would work fine.

If it is not going to work, then please dont hasitate to ask.

Vikas Garg
 
is my reply work for you.

by the way in which profession you are?

I am web-developer

Vikas
 
Yep it works.

I'm by profession a student, but I'm working on a remake of a former ASP website... what I just asked was for the forum :)

Andrew
 
I tried the nl2br() but donno why it's not working as what I espect.

is that this function turn

"This is line one
This is line two"

into

"This is line one<br /> This is line two" ?
 
a test post in the forum I was creating:

"This is a test post, please ONLY test on this topic.<br />
<br />
Andrew"

so yes, that is how it should work.

Andrew
 
in HTML need to do and no matter how you do like that:
Code:
This is string number one<BR>
This is string number two
or
Code:
This is string number one<BR>This is string number two
HTML do not understand double space, only one.
in PHP need to do:
Code:
echo("This is string number one \n This is string number two");
that "\n" and mean bl
but under Windows need type \n\t unde *nix just \n
 
Thanks
I will use Google before asking dumb questions I will use Google before asking dumb questions I will use Google before asking dumb questions I will use Google before asking dumb questions I will use Google before asking dumb questions I will use Google before asking dumb questions I will use Google before asking dumb questions I will use Google before asking dumb questions
:lol:
 
php-vikas
I have search high and low.
Your answer to this solved my problem straght away, Thank you
 
Back
Top