php - safely load HTML from user into textarea -


I am using TinyMCE 4 on a project, where I'm able to pre-populate the texture with HTML Should submit through the post (for server side error handling without deleting all of their work) I know that a Teddera works like a tag, that HTML is not parsed in the dom inside, so most site demos Shows:

& lt; Textarea name = "demo" & gt; & Lt ;? = $ _ POST ['Demo']? & Gt; & Lt; / Textarea & gt;

But what happens when a user submits HTML in which an unmatched & lt; Textarea & gt; or & lt; / Textarea & gt; tag?

Is there a standard way to manage this risk?

use htmlspecialchars ($ _ POST ['demo']) in php When outputing

Comments

Popular posts from this blog

Verilog Error: output or inout port "Q" must be connected to a structural net expression -

jasper reports - How to center align barcode using jasperreports and barcode4j -

c# - ASP.NET MVC - Attaching an entity of type 'MODELNAME' failed because another entity of the same type already has the same primary key value -