Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

EbrahemSamer's avatar

What is the perfect way to Secure html data returned from Database ? PHP Native

I am using TinyMCE Editor to write some articles But I am using posted data without any protection.

when I store article data

$content = $_POST['content'];

I do not use filter_input(INPUT_POST, 'content')

Because it converts html to string

...

When I display data I use

$content = $_POST['content']; `` echo $content;

``

without any serialization..

I wanna secure data and in the same way want html to display as it is.

0 likes
6 replies

Please or to participate in this conversation.