5, December 2008

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

 
Webdigity webmaster forums
This forum shares its ad revenue with its members!
[ 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

Author Topic: PHP to encode form input into mysql back to form - bbcode  (Read 483 times)
Community Supporter ?
What a dork
*
Posts: 17
114 credits
Members referred : 0


« on: Oct 10, 2007, 07: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, 07:25:50 AM »

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

Any tips are welcome!
Global Moderator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 6486
39748 credits
Members referred : 374


It's time to use PHP5!


« Reply #2 on: Oct 10, 2007, 07:59:52 AM »

you can store the html from tinymce in your text type database field


Last blog : Just a better Internet portal provided by Google
Community Supporter ?
What a dork
*
Posts: 17
114 credits
Members referred : 0


« Reply #3 on: Oct 10, 2007, 06:17:49 PM »

That does not answer the question
I am a metal monkey!
Administrator
Community Supporter ?
Jedai Sword Master
*****
Gender: Male
Posts: 8272
42619 credits
Members referred : 3



« Reply #4 on: Oct 10, 2007, 06: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 Visit through proxy or twitter Visit through proxy

Last blog : Free Unlimited Bandwith and disk space to good to be true?
Community Supporter ?
What a dork
*
Posts: 17
114 credits
Members referred : 0


« Reply #5 on: Oct 10, 2007, 06: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: 8272
42619 credits
Members referred : 3



« Reply #6 on: Oct 10, 2007, 06: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 Visit through proxy

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

Last blog : Free Unlimited Bandwith and disk space to good to be true?
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....

Topic sponsors:
Get a permanent link here for $1.99!


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?
Dec 05, 2008, 01:30:39 AM





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!


Forum Statistics
Total Posts: 37.995
Total Topics: 7.685
Total Members: 4.467
Tutorials : 56
Resources : 143
Designs : 220
Latest Member: jschless81

32 Guests, 5 Users online :

10 users online today:



Readers

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