I’m using a HTML form’s TEXTAREA field that will contain text and it may can contain itself some HTML tags.
I have read here that this should be managed using htmlspecialchars function, however this will show the HTML tags in a way it will be quite difficult to allow easy editing of the HTML code into the form TEXTAREA.
What is the safer, easier way to achieve this, ensuring that quotes and “dirty” HTML code will not spoil the form?
I’m using a HTML form’s TEXTAREA field that will contain text and it may
Share
The usual workflow:
<div id="myHtml" style="display: none"><?php echo htmlentities($html); ?></div>tinyMCE.activeEditor.setContent($('#myHtml').html());You can also load the HTML content via AJAX.