28, May 2012

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

 
Webdigity webmaster forums
[ Home | Help | Search | Forum's Shop | Archive | Login | Register | Webmaster Directory ]
Webdigity Webmaster Forums  >  Web Development  >  PhP
Topic: PHP to encode form input into mysql back to form - bbcode
« previous next »
Pages: [1] Print
Instabuck - The easy way to sell digital products online

Author 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 &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!!!!
Community Supporter ?
What a dork
*
Posts: 17
114 credits
Members referred : 0


« Reply #1 on: Oct 10, 2007, 06:25:50 am »

I will be attempting to plug this into an existing form:
http://tinymce.moxiecode.com/example_full.php?example=true

Any tips are welcome!
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
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: Male
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.

Trial and Error my two best teachers Cool
Join us @ facebook or twitter

Last blog : Butterfly Marketing 2.0
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: Male
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?

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

Trial and Error my two best teachers Cool
Join us @ facebook or twitter

Last blog : Butterfly Marketing 2.0
Trackback URI for this entry : http://www.webdigity.com/trackback.php?topic=7213
Tags : php attachment bbcode message encode Bookmark this thread : Digg Del.icio.us Dzone more....

Pages: [1] Print 
Webdigity Webmaster Forums  >  Web Development  >  PhP
Topic: PHP to encode form input into mysql back to form - bbcode
« previous next »
Jump to:
User Area
Welcome, Guest. Please login or register.
Did you miss your activation email?
May 28, 2012, 09:33:11 pm





Login with username, password and session length

Donate to our community, and get a permanent link back to your site!

Donate to our community, and get a permanent link back to your site!






Web Design Gallery · Whois Lookup · Pagerank · Tag Browsing · Lo-fi version · Syndication · Webmaster forum history · Advertise
Developed by HumanWorks © 2005 - 2012 Webdigity webmaster community · sublime directory
Webdigity Webmaster Forums | Powered by SMF 1.0.12. © 2001-2005, Lewis Media. All Rights Reserved.