title: How to save data of text area in php
body: <p><a href="https://i.stack.imgur.com/CrXj5.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/CrXj5.png" alt="enter image description here"></a>I'm a PHP learner. I have a website built on PHP. On the front end of one of our website pages there are four tabs. See the pic below for reference - </p>
  
  <p><a href="https://i.stack.imgur.com/KEdRC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KEdRC.png" alt="enter image description here"></a></p>
  
  <p>I want to add one more tab here. There should be a simple option of adding content in the admin panel for this tab (Which I have accomplished) </p>
  
  <p>My problem is, when I am adding content to the text area in admin panel and hitting submit, the content disappears. I guess the content is not being stored in the database. I checked the SQL file made the possible changes. Although I'm not sure if I did it right. But I'm quite sure that there's a very small lag here which I am not able to figure out.</p>
  
  <p>P.S. Check the screenshot of admin panel for more clarification about my issue.</p>
  
  <p>The text area with heading <strong>Table of Contents - Simple</strong> is the one which I added. But as I mentioned, even if add content here and hit submit it becomes blank.</p>
  
  <p>Below is the code of the page in screenshot -</p>
  
  <pre><code>"&lt;?php
  require_once '../config/config.php';
  require_once '../class/dbclass.php';
  require_once 'class/content.php';
  require_once 'class/category.php';
  require_once 'class/common.php';
  require './isLogin.php';
  
  $content = new Content();
  
  $category = new Category();enter code here
  $catList = $category-&gt;fetchCategoryTree();
  //echo '&lt;pre&gt;';
  //print_r($catList);
  //echo '&lt;/pre&gt;';
  //exit;
  
  //$catParentList = $category-&gt;fetchParentCategory(30);
  
  //echo '&lt;pre&gt;';
  //print_r($catParentList);
  //echo '&lt;/pre&gt;';
  
  //echo implode("-&gt;",$catParentList);
  //echo '&lt;pre&gt;';
  //print_r(array_reverse($catParentList));
  //echo '&lt;/pre&gt;';
  
  //exit;
  
  $cat_id = 0;
  $title = '';
  $price = '';
  $description = '';
  $descriptions = '';
  $author = $published = $report_code = '';
  
  $content_id = isset($_REQUEST['id']) &amp;&amp; $_REQUEST['id'] != "" ? $_REQUEST['id'] : 0;
  //$category_list = $category-&gt;getAllCategory();
  if ($content_id) {
      $contentData = $content-&gt;getContentById($content_id);
      $cat_id = isset($contentData[0]['cat_id']) ? $contentData[0]['cat_id'] : '';
      $title = isset($contentData[0]['title']) ? $contentData[0]['title'] : '';
      $price = isset($contentData[0]['price']) ? $contentData[0]['price'] : '';
      $description = isset($contentData[0]['description']) ? $contentData[0]['description'] : '';
      $descriptions = isset($contentData[0]['descriptions']) ? $contentData[0]['descriptions'] : '';
      $report_code = isset($contentData[0]['report_code']) ? $contentData[0]['report_code'] : '';
      $published = isset($contentData[0]['published']) ? $contentData[0]['published'] : '';
      $author = isset($contentData[0]['author']) ? $contentData[0]['author'] : '';
  
  }
  
  if($content_id == 0)
      $pageName = "Add Report";
  else
      $pageName = "Edit Report";
  ?&gt;
  &lt;?php require_once './includes/header.php'; ?&gt;
  &lt;?php require_once './includes/sidebar.php'; ?&gt;
  
        &lt;!-- Content Wrapper. Contains page content --&gt;
        &lt;div class="content-wrapper"&gt;
          &lt;!-- Content Header (Page header) --&gt;
          &lt;section class="content-header"&gt;
            &lt;h1&gt;
                &lt;b&gt;&lt;?php echo $pageName; ?&gt;&lt;/b&gt;
            &lt;/h1&gt;
            &lt;ol class="breadcrumb"&gt;
              &lt;li&gt;&lt;a href="&lt;?php echo ADMIN_ROOT ?&gt;dashboard.php"&gt;&lt;i class="fa fa-dashboard"&gt;&lt;/i&gt; Home&lt;/a&gt;&lt;/li&gt;
              &lt;li class="active"&gt;&lt;?php echo $pageName; ?&gt;&lt;/li&gt;
            &lt;/ol&gt;
          &lt;/section&gt;
  
          &lt;!-- Main content --&gt;
          &lt;section class="content"&gt;
            &lt;div class="row"&gt;
              &lt;!-- left column --&gt;
              &lt;div class="col-md-12"&gt;
                &lt;!-- general form elements --&gt;
                  &lt;div class="box box-primary"&gt;
                  &lt;div class="box-header with-border"&gt;
                      &lt;?php if (isset($_SESSION['error_message']) &amp;&amp; $_SESSION['error_message'] != ''): ?&gt;
                      &lt;div class="alert alert-danger alert-dismissable"&gt;
                          &lt;button aria-hidden="true" data-dismiss="alert" class="close" type="button"&gt;&lt;i class="glyphicon glyphicon-remove"&gt;&lt;/i&gt;&lt;/button&gt;
                          &lt;?php echo $_SESSION['error_message']; ?&gt;
                      &lt;/div&gt;
                      &lt;?php endif; ?&gt;
                      &lt;?php if (isset($_SESSION['success_message']) &amp;&amp; $_SESSION['success_message'] != ''): ?&gt;
                          &lt;div class="alert alert-success alert-dismissable"&gt;
                              &lt;button aria-hidden="true" data-dismiss="alert" class="close" type="button"&gt;&lt;i class="glyphicon glyphicon-remove"&gt;&lt;/i&gt;&lt;/button&gt;
                              &lt;?php echo $_SESSION['success_message']; ?&gt;
                          &lt;/div&gt;
                      &lt;?php endif; ?&gt;
                      &lt;?php if (isset($_SESSION['info_message']) &amp;&amp; $_SESSION['info_message'] != ''): ?&gt;
                          &lt;div class="alert alert-info alert-dismissable"&gt;
                              &lt;button aria-hidden="true" data-dismiss="alert" class="close" type="button"&gt;&lt;i class="glyphicon glyphicon-remove"&gt;&lt;/i&gt;&lt;/button&gt;
                              &lt;?php echo $_SESSION['info_message']; ?&gt;
                          &lt;/div&gt;
                      &lt;?php endif; ?&gt; 
  
                  &lt;/div&gt;&lt;!-- /.box-header --&gt;
  
                  &lt;!-- form start --&gt;
                 &lt;form id="content-form" action="models/contentProcess.php" enctype="multipart/form-data" method="post" novalidate&gt; 
                      &lt;div class="box-body"&gt;
  
                          &lt;input type="hidden" name="type" value="&lt;?php echo ($content_id == 0) ? "addContent" : "editContent"; ?&gt;"&gt;
                          &lt;input type="hidden" name="content_id" id="content_id" value="&lt;?php echo $content_id ?&gt;"&gt;
  
                          &lt;div class="form-group"&gt;
                              &lt;label&gt;Select Category&lt;/label&gt; 
                              &lt;select id="cat_id" name="cat_id" class="form-control"&gt;
                                  &lt;?php foreach ($catList as $cl) { ?&gt;
                                      &lt;option value="&lt;?php echo $cl["id"] ?&gt;"  &lt;?php echo ($cl["id"] == $cat_id) ? 'selected' : '' ; ?&gt; &gt;&lt;?php echo $cl["name"]; ?&gt;&lt;/option&gt;
                                  &lt;?php } ?&gt;
                              &lt;/select&gt;
                          &lt;/div&gt;
  
                          &lt;div class="form-group"&gt;
                              &lt;label&gt;Title&lt;/label&gt; 
                              &lt;input type="text" name="title" id="title" placeholder="Enter title" class="form-control" value="&lt;?php echo $title ?&gt;"&gt;
                          &lt;/div&gt;
  
                          &lt;div class="form-group"&gt;
                              &lt;label&gt;Report Code&lt;/label&gt; 
                              &lt;input type="text" name="report_code" id="report_code" placeholder="Enter Report Code" class="form-control" value="&lt;?php echo $report_code ?&gt;"&gt;
                          &lt;/div&gt;
  
                          &lt;div class="form-group"&gt;
                              &lt;label&gt;Image&lt;/label&gt; 
                              &lt;input type="file" class="btn btn-default btn-file" name="image" id="image"&gt;
                          &lt;/div&gt;
                          &lt;div class="form-group"&gt;
                              &lt;label&gt;Published&lt;/label&gt; 
                              &lt;input type="text" name="published" id="published" placeholder="Enter published" class="form-control" value="&lt;?php echo $published ?&gt;"&gt;
                          &lt;/div&gt;
  
                          &lt;div class="form-group"&gt;
                              &lt;label&gt;Author&lt;/label&gt; 
                              &lt;input type="text" name="author" id="author" placeholder="Enter author" class="form-control" value="&lt;?php echo $author ?&gt;"&gt;
                          &lt;/div&gt;
                          &lt;div class="form-group"&gt;
                              &lt;label&gt;Price&lt;/label&gt; 
                              &lt;input type="text" name="price" id="price" placeholder="Enter price" class="form-control" value="&lt;?php echo $price ?&gt;"&gt;
                          &lt;/div&gt;
  
                          &lt;div class="form-group"&gt;
                              &lt;label&gt;Description&lt;/label&gt; 
                              &lt;textarea id="description" name="description" class="form-control" rows="10" cols="80"&gt;
                                  &lt;?php echo $description; ?&gt;
                              &lt;/textarea&gt;
                          &lt;/div&gt;
  
                          &lt;div class="form-group"&gt;
                              &lt;label&gt;Table of Contents - Simple&lt;/label&gt; 
                              &lt;textarea id="descriptions" name="descriptions" class="form-control" rows="15" cols="100"&gt;
                                  &lt;?php echo $descriptions; ?&gt;
                              &lt;/textarea&gt;
                          &lt;/div&gt;
  
                          &lt;button class="btn btn-primary" type="submit" id="submitform"&gt;Submit&lt;/button&gt;
                          &lt;a href="&lt;?php echo ADMIN_ROOT; ?&gt;contentList.php" class="btn btn-default"&gt;Cancel&lt;/a&gt;
                      &lt;/div&gt;
                  &lt;/form&gt;
                &lt;/div&gt;&lt;!-- /.box --&gt;
  
              &lt;/div&gt;&lt;!--/.col (left) --&gt;
              &lt;!-- right column --&gt;
  
            &lt;/div&gt;   &lt;!-- /.row --&gt;
          &lt;/section&gt;&lt;!-- /.content --&gt;
        &lt;/div&gt;&lt;!-- /.content-wrapper --&gt;
  &lt;?php require_once './includes/footer.php'; ?&gt;
    &lt;script type="text/javascript" src="&lt;?php echo ADMIN_ROOT; ?&gt;plugins/ckeditor/ckeditor.js"&gt;&lt;/script&gt;
  &lt;script language="javascript"&gt;
      CKEDITOR.replace('descriptions',{
          //uiColor:"#532F12",
          toolbar: 'MyToolbar',
  
      });
  &lt;/script&gt;
  &lt;script language="javascript"&gt;
      CKEDITOR.replace('description',{
          //uiColor:"#532F12",
          toolbar: 'MyToolbar',
      });
  &lt;/script&gt;"
  
      Code snippet of reportDetail.php
  &lt;div class="tab-content" style="min-height:775px;"&gt;
                                          &lt;div id="menu1" class="tab-pane &lt;?php if (!isset($_SESSION['user_id'])) { ?&gt;active&lt;?php } ?&gt;" style="overflow: auto;&lt;?php if (isset($_SESSION['user_id']) &amp;&amp; $_SESSION['user_id'] &gt; 0) { ?&gt;max-height: 1520px;&lt;?php } else { ?&gt; height: 795px;&lt;?php } ?&gt;"&gt;
                                              &lt;?= $contentData['description'] ?&gt;
                                          &lt;/div&gt;
                                          &lt;div id="menu2" class="tab-pane fade &lt;?php if (isset($_SESSION['user_id']) &amp;&amp; $_SESSION['user_id'] &gt; 0) { ?&gt;active in&lt;?php } ?&gt;" style="overflow: auto;&lt;?php if (isset($_SESSION['user_id']) &amp;&amp; $_SESSION['user_id'] &gt; 0) { ?&gt;max-height: 1520px;&lt;?php } else { ?&gt; height: 795px;&lt;?php } ?&gt;"&gt;
                                              &lt;?= $contentData['descriptions'] ?&gt;
                                          &lt;/div&gt;
  
                                          &lt;div id="menu3" class="tab-pane fade &lt;?php if (isset($_SESSION['user_id']) &amp;&amp; $_SESSION['user_id'] &gt; 0) { ?&gt;active in1&lt;?php } ?&gt;" &gt;
  </code></pre>