php所见即所得在线编辑脚本

下载ckeditor_3.6.2.zip ckfinder_php_2.1.zip CKFinderKeyGen.exe 解压于WWW目录下。
打开ckfinder目当下的config.php,第33行改成true
//第38,39行加上注册码:
$config['LicenseName'] = 'abc.domain.com';
$config['LicenseKey'] = 'B5E3BCF4RTURH7T1EHVQT4EZ2DWTUMVE'
第63行$baseUrl = '/ckfinder/userfiles/'

第107 108 109 将值都改成0不限制上传图片的长宽。
第194行可更改允许上传的文件的后缀

 

将以下代码保存为index.php放于WWW目录(输入):

<html>
<body>
<form action="welcome.php" method="post">
<?php
include_once 'ckeditor/ckeditor.php' ;
require_once 'ckfinder/ckfinder.php' ;

 $initialValue = '<p>pl inpunt</p>' ;
 $ckeditor = new CKEditor( ) ;
 $ckeditor->basePath = '/ckeditor/' ;
 CKFinder::SetupCKEditor( $ckeditor, '/ckfinder/' ) ;
 $ckeditor->editor('CKEditor1', $initialValue);
?>

   <input type="submit" value="Submit"/>
</form>

</body>
</html>


将以下代码保存为welcome.php放于www目录(输出结果):(注意魔术引号!!!)

<html>
<body>

<?php
echo  $_POST[CKEditor1]= stripslashes( $_POST[CKEditor1] ) ;
?>
</body>
</html>

 


将以下代码保存为upload.php放于www目录(上传文件用。)


<html >
<head>
 <script type="text/javascript">

// This is a sample function which is called when a file is selected in CKFinder.
function ShowFileInfo( fileUrl, data )
{
 var msg = 'The selected URL is: ' + fileUrl + '\n\n';
 // Display additional information available in the "data" object.
 // For example, the size of a file (in KB) is available in the data["fileSize"] variable.
 if ( fileUrl != data['fileUrl'] )
  msg += 'File url: ' + data['fileUrl'] + '\n';
 msg += 'File size: ' + data['fileSize'] + 'KB\n';
 msg += 'Last modified: ' + data['fileDate'];

 alert( msg );
}

 </script>
</head>
<body>

<?php

require_once 'ckfinder/ckfinder.php' ;

// You can use the "CKFinder" class to render CKFinder in a page:
$finder = new CKFinder() ;
$finder->BasePath = '/ckfinder/' ; // The path for the installation of CKFinder (default =

"/ckfinder/").
$finder->SelectFunction = 'ShowFileInfo' ;
$finder->Create() ;

?>

</form>
</body>
</html>
 

 

 

你可能感兴趣的:(ckeditor,ckfinder,所见即所得,休闲,在线编辑)