Unknown785
New Member
I have a WYSIWYG editor (TinyMCE) to add blog articles to my website. If I just write a fairly normal paragraph:\[code\]<p><strong>Hello world!</strong></p>\[/code\]It outputs just fine. But if I try some extra HTML, for example links and underlines, my editor kicks out the following, which when printed to screen doesn't work or doesn't look right:\[code\]<p>This is some test <span style=\"text-decoration: underline;\">content</span> with <a href=http://stackoverflow.com/"\\"\\\\"http:/www.google.com\\\\"\\"\" target=\"\\"\\\\"_blank\\\\"\\"\">more</a> <em>tags</em> than I would <strong>normally</strong> add.</p>\[/code\]This is a mess of slashes and quotes. How am I supposed to sort this out? Which methods or functions? I'm more concerned about the links than the style tags. Any advice would be great.UPDATE 1I've since used stripslashes() which fixed the \[code\]<SPAN>\[/code\] tag but didn't fix the \[code\]A\[/code\] tag.MY SETUPThis is my TinyMCE editor code:\[code\]<script>tinyMCE.init({ mode : "exact", elements : "content", theme : "advanced", plugins : "autolink,lists,spellchecker,pagebreak,advhr,advlink,iespell,inlinepopups," + "print,noneditable,visualchars,nonbreaking,xhtmlxtras", theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,bullist," + "numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink", theme_advanced_buttons2 : "", theme_advanced_buttons3 : "", theme_advanced_buttons4 : "", theme_advanced_toolbar_location : "top", theme_advanced_toolbar_align : "left", theme_advanced_resizing : true, width: "100%", height: "425"});</script>\[/code\]The textareas content is then posted (POST) to another page via AJAX and then stored as-is to the database. When I go and print this WYSIWYG HTML to the page, from my DB, I write:\[code\]<?phpecho stripslashes($dbResults['article_body']);?>\[/code\]