How to Upload Image in TinyMCE Editor using PHP

An HTML editor is a program for editing HTML, the markup of a web page. It stands for Tiny Moxiecode Content Editor. TinyMCE is a powerful and flexible rich text HTML editor. In this tutorial, you will learn how to Upload Image in TinyMCE HTML Editor using PHP. This is a very simple example, you can just copy paste and change according to your requirement.
Before started to implement the Upload Image in TinyMCE Editor using PHP, look files structure:
  • upload-image-in-tinymce-editor-using-php
    • plugins
    • skins
    • themes
    • upload
    • jquery.tinymce.min.js
    • custom.tinymce.js
    • index.php
    • upload.php
Features
  • Easy integration with your projects
  • Seamless markup integration
  • Predictable editing experience
Step 1: Include the TinyMCE script(plugin)
Include the following line of code in the of a HTML page.
Step 2: TinyMCE editor can be added to a textarea element with the id rich-editor using:.
Java Script Code
  • images_upload_url : Specify a URL for the server-side upload handler.
  • images_upload_handler : This config overrides default upload handler to simulate successful upload.
HTML Code
Step 2: PHP Upload Image Handler (upload.php)
PHP Image Upload using TinyMCE Editor – Output