Hướng dẫn nhúng FCK Editor vào Web.
Khi lập trình web để tiện cho việc soạn thảo bài viết chúng ta thường sử dụng các trình soạn thảo (editor) để nhúng vào Web.
Một trong số đó là FCK editor trang chủ [You must be registered and logged in to see this link.]
Các bước làm:
1. Download source tại đây
[You must be registered and logged in to see this link.]
2. Insert vào nơi bạn muốn đặt FCK editor 1 form
include("ckeditor/ckeditor.php"); vào đầu trang.
Khởi tạo đối tượng FCKEditor, đoạn full code mình sẽ có được như sau.
$CKEditor->replace("content"); với content và tên của text filed
Khi lập trình web để tiện cho việc soạn thảo bài viết chúng ta thường sử dụng các trình soạn thảo (editor) để nhúng vào Web.
Một trong số đó là FCK editor trang chủ [You must be registered and logged in to see this link.]
Các bước làm:
1. Download source tại đây
[You must be registered and logged in to see this link.]
2. Insert vào nơi bạn muốn đặt FCK editor 1 form
- Code:
<form id="form1" name="form1" method="post" action="getdata.php">
<p>
<textarea name="content" cols="60" rows="20"></textarea>
</p>
<p>
<input type="submit" name="Submit" value="Submit" />
</p>
</form>
include("ckeditor/ckeditor.php"); vào đầu trang.
Khởi tạo đối tượng FCKEditor, đoạn full code mình sẽ có được như sau.
- Code:
<?php
include("ckeditor/ckeditor.php");
?>
<form id="form1" name="form1" method="post" action="getdata.php">
<p>
<textarea name="content" cols="60" rows="20"></textarea>
</p>
<?php
$CKEditor = new CKEditor();
$CKEditor->basePath = 'ckeditor/';
$CKEditor->replace("content");
?>
<p>
<input type="submit" name="Submit" value="Submit" />
</p>
</form>
$CKEditor->replace("content"); với content và tên của text filed