handling rich text in php-mysql

Status
Not open for further replies.

bukaida

In the zone
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

हॉर्न ओके प्लीज़
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.
 
OP
bukaida

bukaida

In the zone
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

हॉर्न ओके प्लीज़
^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.
 
Status
Not open for further replies.
Top Bottom