Jump to content


Photo

cms issue


  • Please log in to reply
10 replies to this topic

#1 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 02 October 2006 - 09:41 PM

I have constructed, a mini-cms, something small, for a small purpose.  I am databasing information, to redisplay on a page, but it is not preserving my line breaks for some reason if you put

Privacy Policy(header)
Hello.  What are you doing today.

Doing fine how are you
[end]

If you do that for instance, in the edit field, submit it to the database, and view it on the page it does

hello, what are you doing today.  doing fine how are you

It is not preserving the actual spaces, I can show code if you want but it's probably not valid for the purpose, this is more of a general question I would guess.

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.


#2 manmanman

manmanman
  • Members
  • PipPip
  • Member
  • 22 posts

Posted 02 October 2006 - 09:45 PM

I'm not too sure, but you would probably insert something into the code which replaced new lines with
<br />
.

#3 Barand

Barand
  • Moderators
  • Sen . ( ile || sei )
  • 18,017 posts

Posted 02 October 2006 - 09:45 PM

www.php.net/nl2br
If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received






moon.png

|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts

#4 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 02 October 2006 - 09:57 PM

It's not that, this is the thing.

When I check the database.

it's not doing it either, it's running it all together when I looked at it, my first thought was nl2br, but when it databases it, it's databasing it, as it's running together.

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.


#5 manmanman

manmanman
  • Members
  • PipPip
  • Member
  • 22 posts

Posted 02 October 2006 - 10:01 PM

Wouldn't you nl2br before submitting it to the database?

#6 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 02 October 2006 - 10:02 PM

hmm, I never thought about that, it's worth a try.

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.


#7 Barand

Barand
  • Moderators
  • Sen . ( ile || sei )
  • 18,017 posts

Posted 02 October 2006 - 10:04 PM

NO.
You don't want to store the br tags in the database

Read the FAQ.
If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received






moon.png

|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts

#8 manmanman

manmanman
  • Members
  • PipPip
  • Member
  • 22 posts

Posted 02 October 2006 - 10:07 PM

NO.
You don't want to store the br tags in the database

Read the FAQ.


Which FAQ? MySQL or PHP?

#9 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 02 October 2006 - 10:08 PM

I would think that if you did, then when it outputs back to the browser, it would just have a <br /> on the page to create another linebreak??

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.


#10 Barand

Barand
  • Moderators
  • Sen . ( ile || sei )
  • 18,017 posts

Posted 02 October 2006 - 10:09 PM

php
http://www.phpfreaks....html#msg111774
If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received






moon.png

|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts

#11 Ninjakreborn

Ninjakreborn
  • Members
  • PipPipPip
  • Information Technology Specialist
  • 3,922 posts
  • Age:33

Posted 02 October 2006 - 10:10 PM

ah ok, I will keep that in mind, thanks.

------

Business Website: http://www.infotechnologist.biz

Personal Website: http://www.joyelpuryear.com

Blog Site: http://www.realmofwriting.com
Services: Web development, application development, mobile development, and custom development. All services listed on my website.





0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users