Contact Us Forum Rules Search Archive
WebProWorld Part of WebProNews.com
Page One Link To Us Edit Profile Private Messages Archives FAQ RSS Feeds  
 

Go Back   WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Subscribe to the Newsletter FREE!


Register FAQ Members List Calendar Arcade Chatbox Mark Forums Read

Web Programming Discussion Forum Working with an API? Developing a plugin? Writing a Mod or script for your favorite blog, Web 2.0 site or Forum? Welcome.

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-17-2005, 02:26 PM
WebProWorld Pro
 

Join Date: Jan 2004
Location: Milton Keynes, UK
Posts: 117
DarrenPWS RepRank 0
Default Forum style messaging

Hi again,

Another question:

I am also creating my own phpMySQL based forum - similar to this one but obviously simplified.

I want to know how I can get the output of a message to include line breaks.

At the moment, if I input a message in the textarea box, add it to the db etc. when I retrieve it, the text is on one continuous line.

I found using <pre> had some effect, but if the line of text was too long, it spilled out of my template.

SO... If you could tell me how I could add a

between each line when I insert the values to the database, that would be of great help.

Thanks.

Darren.
Reply With Quote
  #2 (permalink)  
Old 02-17-2005, 04:44 PM
Easywebdev's Avatar
WebProWorld Veteran
 

Join Date: Apr 2004
Posts: 328
Easywebdev RepRank 1
Default

Read up on php's nl2br() function.
It's not always as simple as placing a break tag in front of newline characters. Have a read up on the function and see the different scenarios that can arise.
__________________
"I have not failed. I have found 10,000 ways that don't work" - Thomas Edison.
"The secret to creativity is knowing how to hide your sources" - Albert Einstein.
Reply With Quote
  #3 (permalink)  
Old 02-18-2005, 08:46 AM
WebProWorld Pro
 

Join Date: Jan 2004
Location: Milton Keynes, UK
Posts: 117
DarrenPWS RepRank 0
Default Thanks

Hi Easywebdev.

Thanks for the advice, i will be sure to look into the nl2br() function.

Thanks again.
Reply With Quote
Reply

  WebProWorld > Webmaster, IT and Security Discussion > Web Programming Discussion Forum
Tags: , ,



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Search Engine Optimization by vBSEO 3.2.0