-2

I have a textarea in my HTML. How can I post it to my PHP?

<textarea>
<div id="keditor-content-area-1496927072839" class="keditor-content-area ui-droppable ui-sortable"><section class="keditor-container keditor-initialized-container showed-keditor-toolbar" id="keditor-container-1496927074545">   <section class="keditor-container-inner"><div class="row">        <div class="col-sm-12 keditor-container-content ui-droppable ui-sortable" data-type="container-content" id="keditor-container-content-1496927074546">        <section class="keditor-component keditor-initialized-component" data-type="component-text" id="keditor-component-1496927076874">   <section class="keditor-component-content cke_editable cke_editable_inline cke_contents_ltr cke_show_borders" id="keditor-component-content-1496927076875" contenteditable="true" tabindex="0" spellcheck="false" role="textbox" aria-label="false" aria-describedby="cke_46"><div class="page-header"><h1 style="margin-bottom: 30px; font-size: 50px;"><b class="text-uppercase">Cras justo odio</b> <small>Donec id elit non mi</small></h1><p class="lead"><em>Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.</em></p></div></section><div class="keditor-toolbar keditor-toolbar-component">   <a href="#" class="btn-component-reposition"><i class="fa fa-arrows"></i></a>   <a href="#" class="btn-component-duplicate"><i class="fa fa-files-o"></i></a>   <a href="#" class="btn-component-delete"><i class="fa fa-times"></i></a></div></section></div>    </div></section><div class="keditor-toolbar keditor-toolbar-container">   <a href="#" class="btn-container-reposition"><i class="fa fa-sort"></i></a>   <a href="#" class="btn-container-duplicate"><i class="fa fa-files-o"></i></a>   <a href="#" class="btn-container-delete"><i class="fa fa-times"></i></a></div></section></div>
</textarea>

but it always take Cras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit. in post i want all div tag and all html code. please help me out.

Ankit Sharma
  • 17
  • 1
  • 8
  • I have
    Cras justo odio Donec id elit non miCras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit.
    but i am always getting Cras justo odio Donec id elit non miCras justo odio, dapibus ac facilisis in, egestas eget quam. Donec id elit non mi porta gravida at eget metus. Nullam id dolor id nibh ultricies vehicula ut id elit. in post
    – Ankit Sharma Jun 09 '17 at 06:16
  • You should read [this](https://stackoverflow.com/questions/8973451/display-div-inside-text-area). – Carl Binalla Jun 09 '17 at 06:54

1 Answers1

0

You need something like this:

if(isset($_POST['textarea_value'])){
    echo $_POST['textarea_value'];
}

<form method="post" action="">
    <textarea name="textarea_value"></textarea>
    <input type="submit" value="Send" />
</form>
Carl Binalla
  • 5,393
  • 5
  • 27
  • 46
  • i am making a email template with drag and drop ckediter i want to save this in database but it takes only text not whole html tag in post. in ckediter email is making in div so i have to put div html in textarea before submit . i don't know what wrong with this. – Ankit Sharma Jun 09 '17 at 06:27
  • You asked how to get the value of `textarea` to a `$_POST`, so that is what I answered. Any other concerns should be included in the question – Carl Binalla Jun 09 '17 at 06:37
  • Try using only this, remove your other codes. This should work. – Carl Binalla Jun 09 '17 at 06:45
  • If you want a code that is modified to your need, you should edit your question to what you really need. As it is, my answer should suffice the problem – Carl Binalla Jun 09 '17 at 06:46