Page 1 of 1

PHP code like this one in the forum

Posted: Sun Jul 20, 2008 3:06 am
by new2phpcode
Hi,

im trying to create my blog using PHP and MySQL and i'm trying to create the same format(like in this forum) in which we enter the post in the "post a new topic" page but when i enter the data in Mysql, all formatting are lost. Is there a way on how to control the formatting? or is there a code that automatically enters the HTML code in mysql then when the data is pulled it is automatically formatted with tags? hope someone can give me an idea... Thanks!

Re: PHP code like this one in the forum

Posted: Sun Jul 20, 2008 7:07 pm
by shiznatix
Not quite sure what you mean. Do you mean that all the HTML that you put into the textarea is not saved into the database? If that is the case then you want to look for an offending strip_tags() function call.

If thats not what you mean please post some code and let us know exactly where the HTML is being lost.

Re: PHP code like this one in the forum

Posted: Sun Aug 03, 2008 6:43 pm
by new2phpcode
something like the interface of the "post a reply" link in the forum, where there are buttons for bold, italic,etc...
i dont know the technique on how the datas pulled from the database are formatted when displayed on the page...
The spaces, commas, indentions etc.... when i insert the data from the textarea, all punctuations and formatting are lost so when i pull the data, all is just in a straight line without the formatting... sorry for my english... :)

posting.php?mode=reply&f=1&t=85729

Re: PHP code like this one in the forum

Posted: Sun Aug 03, 2008 6:55 pm
by new2phpcode
i think i've found what i am looking for...

http://us.php.net/wordwrap