Topic: PHP to encode form input into mysql back to form - bbcode (Read 1182 times)
Community Supporter?
What a dork
Posts: 17
114 credits Members referred : 0
« on: Oct 10, 2007, 06:15:17 am »
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 > and < 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!!!!
Community Supporter?
What a dork
Posts: 17
114 credits Members referred : 0
Global Moderator Community Supporter?
Jedai Sword Master
Gender:
Posts: 6691
34714 credits Members referred : 374
It's time to use PHP5!
« Reply #2 on: Oct 10, 2007, 06:59:52 am »
you can store the html from tinymce in your text type database field
Community Supporter?
What a dork
Posts: 17
114 credits Members referred : 0
« Reply #3 on: Oct 10, 2007, 05:17:49 pm »
That does not answer the question
I am a metal monkey!
Administrator Community Supporter?
Jedai Sword Master
Gender:
Posts: 5799
46391 credits Members referred : 3
« Reply #4 on: Oct 10, 2007, 05:29:38 pm »
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.
Community Supporter?
What a dork
Posts: 17
114 credits Members referred : 0
« Reply #5 on: Oct 10, 2007, 05:40:23 pm »
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?
I am a metal monkey!
Administrator Community Supporter?
Jedai Sword Master
Gender:
Posts: 5799
46391 credits Members referred : 3
« Reply #6 on: Oct 10, 2007, 05:43:12 pm »
Quote
The BBCode parser runs on the PHP page and then puts it in the DB?