I currently use FCKeditor to allow users to enter comments, and that info is then stored in our db table. I'm having a problem because I want to display some of that data, but FCKeditor adds <p> and </p> characters around the text. I'm already using my own <p> where I need them, and need to strip out the characters. I know I can use findnocase() but if the characters are in there multiple times, such as: <p>This is just a test</p> <p>Let me know how it works</p> How can I make sure to remove all instances of both <p> and </p> ??
Hey there, Allowing uses to write HTML and javascript can be quite dangerous if it is displayed elsewhere on the site - because everything gets inserted. It sounds like you are trying to fix certain things that have already been inserted. If you want to fix the root of the problem, you can do something like this: <cfif #REFind("<[^>]*>", FORM.USER_TEXT)#> You can throw an error message here. <cfelse> Insert their text into the database. </cfif> Just set FORM.USER_TEXT to whatever your form field is called. Hope this helps. Sincerely, Travis Walters