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 8775405
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T18:47:30+00:00 2026-06-13T18:47:30+00:00

I have spent the last several hours trying to simply post the data (text/html)

  • 0

I have spent the last several hours trying to simply post the data (text/html) that was entered in the ckeditor (textarea) to the PHP file.

Their API claims that the data automatically posts the data on form submissions, but it does not, it returns nothing.

EDIT: here is the real code:

    <?php
    require("fns.php");
    // grab tab content from database
    $tab = array();
    $query ="SELECT * FROM tabs";
    $db_conn = db_connect();
    $results = mysql_query($query,$db_conn);
    while($row = mysql_fetch_array($results))
    {
    $tab[]= $row;
    }

// form validation
if($_POST['btnSave'])
{
    // grab selected tab ID
    $tabId = $_POST['tabId'];
    $title = $_POST['txtTitle'];
    $content = $_POST['ckeditor'];


    // all fields required
    if(isset($tabId) && isset($title) && isset($content))
    {   
        // update recorde where id = tabId
        $query = "UPDATE tabs SET title = '$title', content = '$content' WHERE id = $tabId";
        if($content !== "")
        {
            if(mysql_query($query,$db_conn))
            {
                $message = "<h3 style='color:#003300;'>Changes Saved!</h3><br /><p>".$content."</p>";
                header("Location:testtabs.php");
            }
        }
        else
        {
            $message ="<h3 style='color: #950000;'>Content cannot be blank!</h3>";
        }
    }
}

?>

    <!-- in head section -->
      <script type="text/javascript">  
    $(document).ready(function() {
    // inflate ckeditor
    $('#ckeditor').ckeditor();
    //track selected tab
    var currentId = -1; 
        // Tab initialization
        var $tabs = $('#tabs').tabs({
         select: function(event, ui){
        /*
        ui.index: zero based index selected tab 
        ui.tab: anchor element of the selected tab
        ui.panel: element containing the content for the selected tab
        */

        // get current tab ID for php script
        var currentId = ui.index + 1;
        $("#tabId").val(currentId);
        var tabName = $(ui.tab).text();
        var content = $(ui.panel).html();
        // swap title
        $( '#title' ).val( tabName );
        // swap content
        $("#ckeditor").val(content);
    }   
});

});

    <body>
    <?php  echo $message; ?>
<div id="tabs">
    <ul>
        <li><a href="#tabs-1"><?php echo $tab[0]['title'];?></a></li>
        <li><a href="#tabs-2"><?php echo $tab[1]['title'];?></a></li>
        <li><a href="#tabs-3"><?php echo $tab[2]['title'];?></a></li>
    </ul>
    <div id="tabs-1">
        <div class="content"> 
               <?php echo $tab[0]['content'];  ?>
        </div>
    </div>
    <div id="tabs-2">
        <div class="content"> 
               <?php echo $tab[1]['content'];  ?>
        </div>
    </div>
    <div id="tabs-3">
        <div class="content"> 
               <?php echo $tab[2]['content'];  ?>
        </div>
    </div>
</div>

<?php 
    if (isset($_SESSION['valid_user']) && ($_SESSION['account_type'] == 'ADMIN')) 
    {
        // display editor with tab 1 content
        ?>
        <table id="tab-editor">
            <form action = 'testtabs.php' method ='post'>
            <input type="hidden" id="tabId" name ="tabId" value="-1"/>
                <tr><td>Title: <input type='text' name='txtTitle' id='title' value='<?php echo $tab[0]['title'];?>'/></td></tr>
                <tr><td>Tab Content:</td></tr><tr><td> <textarea name='ckeditor' id='ckeditor' class='tab-editor'><?php //echo $tab[0]['content'];?></textarea></td></tr>
                <tr><td><input type='submit' name='btnSave' value='Save Changes' /></td>
            </form>
        </table>
        <?php
    }
    ?>

  • 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-13T18:47:31+00:00Added an answer on June 13, 2026 at 6:47 pm

    Reverted back to the traditional ckeditor javascript, works fine now…

        CKEDITOR.replace( 'ckeditor' );
        // Tab initialization
    // Tab initialization
    var $tabs = $('#tabs').tabs({
        select: function(event, ui){
            /*
            ui.index: zero based index selected tab 
            ui.tab: anchor element of the selected tab
            ui.panel: element containing the content for the selected tab
            */
    
            // get current tab ID for php script
            var currentId = ui.index + 1;
            $("#tabId").val(currentId);
            var tabName = $(ui.tab).text();
            var content = $(ui.panel).html();
            // swap title
            $( '#title' ).val( tabName );
            // swap content
            CKEDITOR.instances['ckeditor'].setData(content);
    
        }   
    });
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have spent the last several hours trying to get this to work and
I have spent the last 3 hours trying to get this code working. I
I have spent the last several hours scouring the internet looking for examples and
I have spent last few hours trying to understand why my javascript timer is
I have spent the last several years fighting tooth and nail to avoid working
I have spent the last hour trying to see what I'm doing wrong, or
I have spent the last 2 days trying to find out how to do
Urgh, I have spent the last couple of hours on this now. I normally
I hope someone can help me as I've already spent several hours trying to
I have spent last couple of hours searching for answers here but nothing seems

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.