Insert Clean data using text editor |
Hello folks,
Why this types of html code are inserted in my db table ? My Model code is Code: public function create_post() My Controller code is Code: public function create() Code: <div class="form-group row">
You're using a rich text editor - TinyMCE - which generates HTML. If you want to restrict what it creates, either use a strip_tags call in the model, or, better yet, look at TinyMCE's options to get it like you want it there.
Remove Full Page Plugin
https://www.tinymce.com/docs/plugins/fullpage/ And add HTML Purifier so that you don't get vulnerable to XSS attacks http://htmlpurifier.org/
I had issues with html code generated by rich text editors as well, so now i use medium editor with markdown plugin to give my users a bit of formatting capabilities and also allow easily readable extracts to be generated from the database (into xlsx)
When displaying the markdown from the database i use http://parsedown.org to convert the markdown test back to nice html. http://ionicabizau.github.io/medium-edit...n/example/ |
Welcome Guest, Not a member yet? Register Sign In |