Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用所见即所得编辑器在PHP中使用htmlentities_Php_Wysiwyg_Html Entities - Fatal编程技术网

使用所见即所得编辑器在PHP中使用htmlentities

使用所见即所得编辑器在PHP中使用htmlentities,php,wysiwyg,html-entities,Php,Wysiwyg,Html Entities,我试图在页面的文本区域标记中添加一个简单的WYSIWYG编辑器,但我也想防止跨站点脚本攻击。不幸的是,这两个人似乎不太合拍。我知道这个问题不会有一个“正确”的答案,但我希望有人能帮助我思考这里需要考虑的问题 下面是代码的摘录,可以稍微解释一下这个问题: <html> <head> //I'm using NicEdit as my WYSIWYG editor <script type="text/javascript" src="http://js.n

我试图在页面的文本区域标记中添加一个简单的WYSIWYG编辑器,但我也想防止跨站点脚本攻击。不幸的是,这两个人似乎不太合拍。我知道这个问题不会有一个“正确”的答案,但我希望有人能帮助我思考这里需要考虑的问题

下面是代码的摘录,可以稍微解释一下这个问题:

<html>
  <head>
  //I'm using NicEdit as my WYSIWYG editor
  <script type="text/javascript" src="http://js.nicedit.com/nicEdit-latest.js"></script> <script type="text/javascript">
    //<![CDATA[
    bkLib.onDomLoaded(function() { nicEditors.allTextAreas() });
    //]]>
  </script>
  </head>
  <body>
  <form action="<?php echo($TargetURL); ?>" method="POST">
    <textarea id="fNotes" name="fNotes" style="width: 100%; height: 100px; ">
      <?php
        echo(htmlentities($show->Notes));
      ?>
    </textarea>
  </form>
  </body>
</html>

//我正在使用NicEdit作为我的所见即所得编辑器
//

我最初的想法是创建一个函数来去除出现在$shows->Notes字段中的andy标记,但我不确定需要去除多少。我最初的想法是创建一个函数来去除出现在$shows->Notes字段中的andy标记,但我不确定需要去除多少。
"Random <b>words</b> stuck in to test the text<br>"