简体   繁体   English

如何在 PHP 中从 mysql 显示 ckeditor 中的数据

[英]How to display data in ckeditor from mysql in PHP

I am new in this field, I used ckeditor but I don't know how to display data in ckeditor through mysql..我是这个领域的新手,我用过 ckeditor 但我不知道如何通过 mysql 在 ckeditor 中显示数据..

My code is我的代码是

$CKeditor = new CKeditor();
$CKeditor->BasePath = 'manage-site/';
$CKeditor->config['filebrowserBrowseUrl'] = 'ckfinder/ckfinder.html';
$CKeditor->config['filebrowserImageBrowseUrl'] = 'browser/browser.php?type=Images';
$CKeditor->config['filebrowserFlashBrowseUrl'] = 'ckfinder/ckfinder.html?type=Flash';
$CKeditor->config['filebrowserUploadUrl'] = 'ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Files';
$CKeditor->config['filebrowserImageUploadUrl'] = 'uploader/uploader.php?type=Images';
$CKeditor->config['filebrowserFlashUploadUrl'] = 'ckfinder/core/connector/php/connector.php?command=QuickUpload&type=Flash';
$CKeditor->editor('page_desc','**page_desc**');

For display content I use对于我使用的显示内容

<?php echo stripslashes($details[0]["page_desc"]); ?>

I wanted to display on the place of Page_desc(last Line of Code) .我想在Page_desc(last Line of Code)的地方显示。 How to do that?怎么做?

You can simply download the ckeditor package and do this simple 2 step您可以简单地下载 ckeditor 包并执行这个简单的 2 步

Step 1 : Include the ckeditor.js from your file第 1 步:从您的文件中包含ckeditor.js

<script type="text/javascript" src="ckeditor/ckeditor.js"></script>

Step 2 : Include the class name as ckeditor to your textarea第 2 步:将类名作为ckeditor包含到您的textarea

Then you can see the ckeditor with simple step然后你可以通过简单的步骤看到ckeditor

Note : Make sure the ckeditor.js is in the proper path注意:确保 ckeditor.js 在正确的路径中

Hope this helps you希望这对你有帮助

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM