Sublime directory Surf the web anonymous Pagerank Monitor


PHP to encode form input into mysql back to form - bbcode

apple2
Wed 10 October 2007, 06:15 am GMT +0200
What is the basic sequence of encoding for the database? Is this correct?

User submits form input

On the server:
PHP sends form input to BBcode parser which replaces all <> with &gt; and &lt;
The BBcode parser then replaces all BBcode tags [] with corresponding html <> tags and stores that in the database.

To send display code to the client you just send the post contents straight from the database.
To display the code in a form you must send it to the bbcode unparser so it switches its known html tags back to bbcode.

On top of that some editors allow you to edit the bbcode but in a rendered view.
How is html being rendered in the form input area?

Should my PHP code be replacing /n from the form input with <br> or is that the parsers job?

Thanks!!!!

apple2
Wed 10 October 2007, 06:25 am GMT +0200
I will be attempting to plug this into an existing form:
http://tinymce.moxiecode.com/example_full.php?example=true

Any tips are welcome!

olaf
Wed 10 October 2007, 06:59 am GMT +0200
you can store the html from tinymce in your text type database field

apple2
Wed 10 October 2007, 05:17 pm GMT +0200
That does not answer the question

Nikolas
Wed 10 October 2007, 05:29 pm GMT +0200
I think you misunderstood the purpose of the bbcode parser. It is supposed to use bbcode instead of html, and in the database you keep the bbcode, not html. If you want you can use a table field to keep parsed data for faster performance, but the purpose is use bbcode with no html at all.

apple2
Wed 10 October 2007, 05:40 pm GMT +0200
my first post is hoping for an answer of the data cycle and its format.
form to server to database back to form and html display.

"in the database you keep the bbcode"
Great! Thanks! I have one of the answers to the cycle.

I supposed there is no jscript validation on the client side when sending form data.
The BBCode parser runs on the PHP page and then puts it in the DB?

simply stating the flow of information and conversion is all I ask.



So it is unparsed (what is word for reversing BBcode?) for html display or sent straight from the DB to the form?

Nikolas
Wed 10 October 2007, 05:43 pm GMT +0200
Quote
The BBCode parser runs on the PHP page and then puts it in the DB?

Sure, otherwise you wont be sure what the user actually posts. Maybe you will need the help of this great open source project : http://christian-seiler.de/projekte/php/bbcode/index_en.html

Archive for SMF v1.00 by N.P. Valid XHTML 1.0 Transitional