Ninjakreborn Posted October 2, 2006 Share Posted October 2, 2006 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[b]Privacy Policy[/b](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 doeshello, what are you doing today. doing fine how are youIt 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. Link to comment https://forums.phpfreaks.com/topic/22799-cms-issue/ Share on other sites More sharing options...
manmanman Posted October 2, 2006 Share Posted October 2, 2006 I'm not too sure, but you would probably insert something into the code which replaced new lines with [code]<br />[/code]. Link to comment https://forums.phpfreaks.com/topic/22799-cms-issue/#findComment-102697 Share on other sites More sharing options...
Barand Posted October 2, 2006 Share Posted October 2, 2006 www.php.net/nl2br Link to comment https://forums.phpfreaks.com/topic/22799-cms-issue/#findComment-102698 Share on other sites More sharing options...
Ninjakreborn Posted October 2, 2006 Author Share Posted October 2, 2006 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. Link to comment https://forums.phpfreaks.com/topic/22799-cms-issue/#findComment-102706 Share on other sites More sharing options...
manmanman Posted October 2, 2006 Share Posted October 2, 2006 Wouldn't you nl2br before submitting it to the database? Link to comment https://forums.phpfreaks.com/topic/22799-cms-issue/#findComment-102708 Share on other sites More sharing options...
Ninjakreborn Posted October 2, 2006 Author Share Posted October 2, 2006 hmm, I never thought about that, it's worth a try. Link to comment https://forums.phpfreaks.com/topic/22799-cms-issue/#findComment-102710 Share on other sites More sharing options...
Barand Posted October 2, 2006 Share Posted October 2, 2006 NO.You don't want to store the br tags in the databaseRead the FAQ. Link to comment https://forums.phpfreaks.com/topic/22799-cms-issue/#findComment-102712 Share on other sites More sharing options...
manmanman Posted October 2, 2006 Share Posted October 2, 2006 [quote author=Barand link=topic=110293.msg445631#msg445631 date=1159826644]NO.You don't want to store the br tags in the databaseRead the FAQ.[/quote]Which FAQ? MySQL or PHP? Link to comment https://forums.phpfreaks.com/topic/22799-cms-issue/#findComment-102714 Share on other sites More sharing options...
Ninjakreborn Posted October 2, 2006 Author Share Posted October 2, 2006 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?? Link to comment https://forums.phpfreaks.com/topic/22799-cms-issue/#findComment-102715 Share on other sites More sharing options...
Barand Posted October 2, 2006 Share Posted October 2, 2006 phphttp://www.phpfreaks.com/forums/index.php/topic,31047.msg111774.html#msg111774 Link to comment https://forums.phpfreaks.com/topic/22799-cms-issue/#findComment-102716 Share on other sites More sharing options...
Ninjakreborn Posted October 2, 2006 Author Share Posted October 2, 2006 ah ok, I will keep that in mind, thanks. Link to comment https://forums.phpfreaks.com/topic/22799-cms-issue/#findComment-102717 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.