Sabtu, 06 September 2014

Cara Mudah Membuat Rich Editor

pernahkah kalian mengirim email..??? banyak tool" yg mempermudah anda, seperti menebalkan huruf,mewarnai huruf dan sebagai nya.. contohnya sebut saja yahoo atau Gmail

Nah... kali ini kita akan membuat sebuah text editor yang lebih lengkap....!

catatan: seblum'a anda harus memahami HTML,Php dan mysql,

1.pertama-tama anda harus mendownload terlebih dahulu text editornya
 Klik disini
2.setelah itu letakan di C:\appserv\www\rich_text_editor
 seperti gambar dibawah ini....


3.setelah itu kita akan menghubung kan file ckeditor.js dan content.css yg berada didalam folder ckeditor,
4.Buatlah sebuah file php dengan nama index.php copy script di bawah ini...! 
<html>
<head>
  <title>Rich Text Editor</title>
  <script type="text/javascript" src="ckeditor/ckeditor.js"></script>
  <link href="ckeditor/content.css" rel="stylesheet" type="text/css"/>

</head>
<body>
<?php
  if (isset($_REQUEST['ok'])){
    $judul = $_REQUEST['judul'];
    $content = $_REQUEST['news'];
    echo "Judul:<b>$judul</b><br/>";
    echo "Isi berita:<br/>$content<br/>";
  }
?>
<h1>Input Berita</h1>
<form method="post" action="<?php $_SERVER['PHP_SELF'] ?>">
<table border="0" cellpadding="0" cellspacing="0">
<tr>
    <td>Judul</td>
    <td><input type="text" name="judul" size="50"/></td>
</tr>
<tr>
    <td valign="top">Isi Berita</td>
    <td>
        <textarea cols="80" id="news" name="news" rows="10"></textarea>
                <script type="text/javascript">
                    var editor = CKEDITOR.replace('news');
                </script>
    </td>
</tr>
<tr>
    <td colspan="2">
        <input type="submit" value="Simpan" name="ok"/>
    </td>
</tr>
</table>
</form>
</body>
</html>
5.Save file index.ph di folder rich_text_editor
6.buka browser anda lalu jalankan index.php ketikan di URL browser anda http://localhost/rich_text_editor/
7. hasilnya seperti ini... :D
8. smoga bermanfaat....!