Home >php教程 >php手册 >CKEditor && CKFinder 配置

CKEditor && CKFinder 配置

WBOY
WBOYOriginal
2016-06-13 09:45:121058browse

CKEditor&&CKFinder破解版百度网盘地址:密码:yydcdut

   

config.js

<span 1</span> CKEDITOR.editorConfig = <span function</span><span ( config )
</span><span 2</span> <span {
</span><span 3</span>     config.language = 'zh-cn'<span ;
</span><span 4</span>     config.uiColor = '#FFA'<span ;
</span><span 5</span>     config.skin = 'v2'<span ;
</span><span 6</span>     config.width = 850<span ;
</span><span 7</span>     config.height = 400<span ;
</span><span 8</span>     config.toolbar = 'Full'<span ;
</span><span 9</span> };

<span  1</span> <span <</span><span html</span><span ></span>
<span  2</span> <span <</span><span head</span><span ></span>
<span  3</span>     <span <</span><span meta </span><span http-equiv</span><span ="Content-type"</span><span  content</span><span ="text/html; charset=UTF-8"</span><span ></span>
<span  4</span>     <span <</span><span title</span><span >yyd</span><span </</span><span title</span><span ></span>
<span  5</span> <span </</span><span head</span><span ></span>
<span  6</span> <span <</span><span body</span><span ></span>
<span  7</span>     <span <</span><span form </span><span action</span><span ="post.php"</span><span  method</span><span ="post"</span><span ></span>
<span  8</span>         <span <</span><span textarea </span><span name</span><span ="editor1"</span><span ></span>yyd<span </</span><span textarea</span><span ></span>
<span  9</span>         <span <</span><span input </span><span type</span><span ="submit"</span><span  name</span><span ="submit"</span><span  value</span><span ="Submit"</span> <span /></span>
<span 10</span>     <span </</span><span form</span><span ></span>
<span 11</span> <span </</span><span body</span><span ></span>
<span 12</span> 
<span 13</span> <span <</span><span script </span><span src</span><span ="ckeditor/ckeditor.js"</span><span ></</span><span script</span><span ></span>
<span 14</span> <span <</span><span script </span><span type</span><span ="text/javascript"</span><span ></span>
<span 15</span>     <span //</span><span  启用 CKEitor 的上传功能,使用了 CKFinder 插件</span>
<span 16</span> <span     CKEDITOR.replace( </span><span '</span><span editor1</span><span '</span><span , {
</span><span 17</span> <span         filebrowserBrowseUrl        : </span><span '</span><span ckfinder/ckfinder.html</span><span '</span><span ,
</span><span 18</span> <span         filebrowserImageBrowseUrl   : </span><span '</span><span ckfinder/ckfinder.html?Type=Images</span><span '</span><span ,
</span><span 19</span> <span         filebrowserFlashBrowseUrl   : </span><span '</span><span ckfinder/ckfinder.html?Type=Flash</span><span '</span><span ,
</span><span 20</span> <span         filebrowserUploadUrl   : </span><span '</span><span ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files</span><span '</span><span ,
</span><span 21</span> <span         filebrowserImageUploadUrl   : </span><span '</span><span ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Images</span><span '</span><span ,
</span><span 22</span> <span         filebrowserFlashUploadUrl   : </span><span '</span><span ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash</span><span '</span>
<span 23</span> <span     });
</span><span 24</span> <span </</span><span script</span><span ></span>
<span 25</span> <span </</span><span html</span><span ></span>

   

        

  • 在与CKEditor和CKFinder同目录下创建文件夹
  • 改修文件

  第行的函数

<span  1</span> <span function</span><span  CheckAuthentication()
</span><span  2</span> <span {
</span><span  3</span>     <span //</span><span  WARNING : DO NOT simply return "true". By doing so, you are allowing
</span><span  4</span> <span     // "anyone" to upload and list the files in your server. You must implement
</span><span  5</span> <span     // some kind of session validation here. Even something very simple as...
</span><span  6</span> 
<span  7</span> <span     // return isset($_SESSION['IsAuthorized']) && $_SESSION['IsAuthorized'];
</span><span  8</span> 
<span  9</span> <span     // ... where $_SESSION['IsAuthorized'] is set to "true" as soon as the
</span><span 10</span> <span     // user logs in your system. To be able to use session variables don't
</span><span 11</span> <span     // forget to add session_start() at the top of this file.
</span><span 12</span> 
<span 13</span> <span     //return false;</span>
<span 14</span>     <span return</span> <span true</span><span ;
</span><span 15</span> }

  第行,即修改为创建的uploads路径

<span 1</span> <span $baseUrl</span> = '/CK/plugins/uploads/';

 

  实现截图

    

  创建文件,将传递过来的POST打印出来

<span 1</span> <?<span php
</span><span 2</span> <span header</span>("Content-Type:text/html; charset=utf-8"<span );
</span><span 3</span> <span $str</span> = <span $_POST</span>['editor1'<span ];
</span><span 4</span> <span $data</span> = <span stripslashes</span>(htmlspecialchars_decode(<span $str</span><span ));
</span><span 5</span> <span echo</span> <span $data</span><span ;
</span><span 6</span> ?>

 

    

  当我配置完成后,submit提交之后死活都不能显示图片,查看源代码的时候,发现双引号被转义了,觉得很蛋疼。我不知道这个CKEditor转义的还是浏览器转义的,因为就在前几天,我在测试SQL注入的时候就发现明明可以注入的,但死活不出来结果,然后在本机上将password传递过去的值打印出来了,发现是被转义了,表示很蛋疼。所以我在这里用了$data = stripslashes(htmlspecialchars_decode($str));将转义之后再反转义湖区,结果就OK了。

  CKEditor&&CKFinder组合不仅可以上传图片,还可以上传文件等。

 

 

 

转载请注明出处:http://www.cnblogs.com/yydcdut/p/3518102.html 

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn