0

I have a website which has a section called "Announcemnet" at the home page. There should be some announcemnet in this section.In order to have it, I have to have the following files:

I have a file called Announcement.php. In this file I have the sript to access a rich text editor, which also loads the exsiting Annoncemnet and also allows users to edit and save it.

(This is what I have wriiten by now)

    <?php

                $temp= file_get_contents('./inc/announcement.html');
                require_once(FACULTY180_CLASS_ROOT.'TinyMCEMaker.php');
                $richtext = new TinyMCEMaker('basic');
                $richtext->editor('Description', $temp);
                ?>

                <script>
                function get_editor_content() {

                      //method1 getting the content of the active editor
                      var a = tinyMCE.activeEditor.getContent();

                    }
                </script>
                <button onclick="get_editor_content()">Save</button> 

I have another file called Announcement.html, it has the saved contents of the rich text editor, It only has the HTML of the firstfile.php file.

Then another file called Home.php, read and output the secondfile.html

(I have added the following line to Home.php)

     <EMBED src="./inc/Announcement.html">

So right now if I added something manualy to Announcement.html file, then my rich text editor loads it. Also what I ahve added to Announcement.html file is displayed at home page. I just do not know how can I update conetents of Announcement.html file when user clicks on the Save button.(You can see that there is a Save button after rich text editor).

0 Answers0