adrian28uk Posted June 4, 2008 Share Posted June 4, 2008 I have found a script that allows me to enter rich text via wysiwyg editor on my site. It works great and inserts the html code to the field [ descripton ] in my database. I am now scratching my head on how I convert this back to my webpage for a preview. When I output this back to my page it showing me the html code only. the < becomes < " becomes " And so on. I need it to output and convert the html code so it shows the preview Hope you can make some sense of thos. Quote Link to comment Share on other sites More sharing options...
pocobueno1388 Posted June 4, 2008 Share Posted June 4, 2008 Take a look at the html_entity_decode() function. Quote Link to comment Share on other sites More sharing options...
adrian28uk Posted June 4, 2008 Author Share Posted June 4, 2008 That works a treat. Bloody hell I have messing around with this for about 2 hours looking for a function. Thank you very much. Quote Link to comment Share on other sites More sharing options...
discomatt Posted June 4, 2008 Share Posted June 4, 2008 Be VERY careful with HTML input from untrusted sources. People can throw any data they want into a POST request, including dangerous javascript... if this is outputted to the end user at any point, an XXS attack can be easily performed. Quote Link to comment Share on other sites More sharing options...
adrian28uk Posted June 4, 2008 Author Share Posted June 4, 2008 Then I suppose we need something that looks for a javascript tag? Quote Link to comment Share on other sites More sharing options...
discomatt Posted June 4, 2008 Share Posted June 4, 2008 Here's a GREAT script that cleans XSS attacks for you http://htmlpurifier.org/ Quote Link to comment Share on other sites More sharing options...
pocobueno1388 Posted June 4, 2008 Share Posted June 4, 2008 Here's a GREAT script that cleans XSS attacks for you http://htmlpurifier.org/ I second that. I've used the htmlpurifier class, and it works great. Quote Link to comment Share on other sites More sharing options...
adrian28uk Posted June 4, 2008 Author Share Posted June 4, 2008 Brilliant. Thank you all for your help. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.