Hi all
I use WYSIWYG editors with some of my sites that I build and I keep coming across the same problem.
When I POST the page content to save it, I want to ensure that all characters within my text content such as & < > etc are converted to the correct equivalent such as & < etc however when I apply htmlspecialchars to my POST as such:
$content = mysql_real_escape_string(htmlspecialchars($_POST['textcontent']));
This converts the <p> tags and <strong> tags (and all other html tags) within the source of my content.
Is there a way around this?
I.e. I only want to convert these characters within my text content and not the html tags.
Thanks for reading