Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8968747
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T17:29:50+00:00 2026-06-15T17:29:50+00:00

I want to use inline edit of the new CKEditor 4 ( http://docs.ckeditor.com/#!/guide/dev_inline-section-2 ),

  • 0

I want to use “inline edit” of the new CKEditor 4 (http://docs.ckeditor.com/#!/guide/dev_inline-section-2), but can not find any example of how to save the data with PHP / MySQL.
Can you help me?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T17:29:51+00:00Added an answer on June 15, 2026 at 5:29 pm

    You need some AJAX magic. Via JavaScript inside the page you get the edited HTML. Then you send it to the server where a PHP script gets it and can pass it onto MySQL.

    Here is a simple test case which will show you the ropes.

    Let’s start with the editable HTML.

    <div id='textToBeSaved' contenteditable='true'>
        <p>Using the <strong>Terminal</strong> in OS X makes you all-powerful.</p>
    </div>
    

    We also need a “Save” button which will be used to start the POST event.

    <button onclick='ClickToSave()'>Save</button>
    

    Such a button could well we positioned in the CKEditor toolbar itself, but that would require more coding and I’ll leave it to someone who’s better at JavaScript than me.

    Of course you want to include CKEditor. For my sample code I’ll also make use of jQuery, which I’ll use for AJAXing the results.

    <script src='//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js' type='text/javascript'></script>
    <script type='text/javascript' src='CKEditor4/ckeditor.js'></script>
    

    Now the script which will execute when you press the “Save” button. It will use CKeditor to grab the edited HTML, then jQuery to send it.

    <script type='text/javascript' language='javascript'>
    // <![CDATA[
    function ClickToSave () {
        var data = CKEDITOR.instances.textToBeSaved.getData();
        $.post('save.php', {
            content : data
            })
        }
    // ]]>
    

    This is it, you don’t need anything else clientside.

    On the server, you must have the PHP code which will act when the script POSTs the updated HTML. The script must be called save.php and be positioned in the same directory where the HTML is if you use my code verbatim.
    My one-liner here will just save your HTML in a temporary file inside the /tmp folder. Feel free to add your MySQL magic instead.

    <?php
    file_put_contents('/tmp/serverside.html', $_POST['content']);
    ?>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want use BYTE_ORDER macro in my Xcode project but i can't because i
I am not very good in inline assembly, but planning to use it for
I want to use a global variable in inline assembly. asm( LDR R0,g_TsInitStackPointerAddress); Here
I want use JQuery mobile for the front-end of my mobile application, but I
I am use jqGrid. I want to add record inline navigation so this link
I need to use inline edit in my application. For this purpose I am
What I want to do is similar to what is done here http://www.starbucks.com/static/reference/styleguide/layout_promo_c.aspx I
I want use this 1 for using Bar code or QR code scanner. I
I want use javascript setInterval function to achieve a box rotate animate effect, I
I want use a single php file to handle all of my voting requests.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.