General Programming Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
User Name:
Password:
Remember me
 
Go Back   Dev Articles Community ForumsProgrammingGeneral Programming Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Display Modes
 
Unread Dev Articles Community Forums Sponsor:
  #1  
Old July 11th, 2003, 01:45 PM
thecharking thecharking is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 187 thecharking User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via AIM to thecharking
no breaks in my posts

alright so here is the problem.

I have a site, it has a news system and a few other things that users can post to. the psoting is good, except that it doesn't put breaks in the text. I hit enter and psot, and it stays all on one line.

like this:

Here
is
the
text

this would be
here is the text

I thought about using my ereg replace that iw as using to put in bold and italics, by replacing [br] with <br>
but that's too much work. It is put into the database as longtext : 9999

why does it do this? and what is the best way to do it if this isn't?
__________________
hey it's the CHARKING

Reply With Quote
  #2  
Old July 11th, 2003, 02:22 PM
avit avit is offline
Not Yet Perfect
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Nov 2002
Location: Squamish, BC
Posts: 111 avit User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Send a message via ICQ to avit
I suspect that there are breaks in the text, but when it gets re-displayed in HTML, they don't show because they have to be <br>s. You could try replacing \n (newline character) with <br> to see if that does it for you.

Not sure if you want to do this when it gets entered into the database, or rather when it gets pulled out and displayed.

Reply With Quote
  #3  
Old July 11th, 2003, 07:20 PM
_rainbow_ _rainbow_ is offline
Registered User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: Lj, Slovenia
Posts: 27 _rainbow_ User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 4 m 28 sec
Reputation Power: 0
nl2br() should do the trick. I expect no further explanation is needed.

Reply With Quote
  #4  
Old July 11th, 2003, 10:05 PM
AmericanD AmericanD is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Oct 2002
Posts: 81 AmericanD User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 7
Quote:
Originally posted by _rainbow_
nl2br() should do the trick. I expect no further explanation is needed.


sweet
__________________
Hungry for Code

Programming works best with a team over one single person

Reply With Quote
  #5  
Old July 12th, 2003, 04:45 PM
thecharking thecharking is offline
Contributing User
Dev Articles Newbie (0 - 499 posts)
 
Join Date: Apr 2003
Posts: 187 thecharking User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 6
Send a message via AIM to thecharking
thanks

once again devarticles is the greatest place ever. thanks guys that totally fixed it.

Reply With Quote
Reply

Viewing: Dev Articles Community ForumsProgrammingGeneral Programming Help > no breaks in my posts


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
Stay green...Green IT