DIGIT-ARC read-only archive · snapshot: July 23, 2026

handling rich text in php-mysql

4 posts · originally from https://geek.digit.in/community/threads/handling-rich-text-in-php-mysql.85203/

bukaida
bukaida Original post #1
Apr 12, 2008 at 11:36 PM
I want to know the process of accepting the superscript and subscript data from html textbox through php and store them in mysql database.Also support for other rich text format is required.
please help.I am using PHP 4.4.0 with mysql 5 and apache 2.
victor_rambo
Apr 12, 2008 at 11:52 PM
You can just store them as HTML. But, while passing them to the sql statement, remember to use the addslashes() function. Similarly, while retrieving the records, just use stripslashes() function.

btw I hope you know how to process form inputs with PHP. If not, plz google it.
bukaida
bukaida #3
Apr 14, 2008 at 12:52 PM
You can just store them as HTML.

How are you going to write a superscript or subscript in textbox?When I am copying and pasting the superscript/subscript data from MS.Word, it is coming side by side in the text box.I know how to accept data from textbox, but the data itself is not in desired format.I hope you understood the problem.
victor_rambo
Apr 14, 2008 at 7:55 PM
^in that case, a textbox wouldn't do what you want. You should use a textarea which is converted into a WYSIWYG editor by javascript.

1. Download TinyMCE. It will convert a textarea element into WYSIWYG HTML editor.
2. Copy-paste the rich text in the WYSIWYG editor.
3. Use it as a form element.