Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need help with wrap when hitting the return key

Status
Not open for further replies.

cs7536

Programmer
Joined
Apr 20, 2003
Messages
130
Location
US
I want to know if someone can please help me with this issue.

I want to be able to click the return key on the keyboad and it go to the next line on he script. When I hit return or enter it goes to the next line when typing but when I access the content from the database it is all together it does not show the next line.

example I would like:

hello hello hello
anddjjfkjfdkjfjdkjfkdkjfd.

instead of:

hello hello hello anddjjfkjfdkjfjdkjfkdkjfd

Nothing is hard when you realy want to learn it.

Max
 
does anybody have a solution.

Nothing is hard when you realy want to learn it.

Max
 
Write a procedure to replace chr(13) to <BR>. Call this procedure before writing your strin to the database. When you print it you will see text in two lines in the browser.
 
not understanding clear, can you sample please

Nothing is hard when you realy want to learn it.

Max
 
its simple:
$string=&quot;STRING FROM DATABASE&quot;;
echo nl2br($string);

does this help?

Known is handfull, Unknown is worldfull
 
vbkris

where do I add this script? does this go on my insert to database page or does it go on the form?

thanks
Max


Nothing is hard when you realy want to learn it.

Max
 
$string=&quot;STRING FROM DATABASE&quot;;
echo nl2br($string);

where do I put this? on what page?

Thanks
Max

Nothing is hard when you realy want to learn it.

Max
 
the code i gave is for display to the user. in the databse it WILL be stored in one line....

but that musnt bother u much.

howeever if u r retrieving the data in a textarea then
$string is the data that comes from the database.

<textarea><?=$string?></textarea> will do.

Known is handfull, Unknown is worldfull
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top