title: How to pass content in TinyMCE's textarea to a PHP file directly instead of sending via AJAX?
body: <p>I build a simple webpage with embeded TinyMCE.</p>
  
  <p>The HTML part:</p>
  
  <pre><code>&lt;form method="post" action="dump.php"&gt;
  &lt;div id="main"&gt;
  &lt;div id="container_left"&gt;
          &lt;textarea id="mytextarea"&gt;&lt;/textarea&gt;
          &lt;input id="submit" type="submit" value="submit"&gt;            
  &lt;/div&gt;
  &lt;div id="show_right"&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>The JavaScript part.</p>
  
  <pre><code>&lt;script src="tinymce/tinymce.min.js"&gt;&lt;/script&gt;
  &lt;script type="text/javascript"&gt;
  tinymce.init({
      selector: "textarea",
      height: 250,
      plugins: [
          "code advlist autolink lists link image charmap print preview anchor",
          "searchreplace visualblocks code fullscreen",
          "insertdatetime media table contextmenu paste"
      ],
      toolbar: "code insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image",
      setup: function (editor) {
          editor.on('init keydown change', function (e) {
             document.getElementById('show_right').innerText = editor.getContent();
          });
      }
  });
  &lt;/script&gt;
  </code></pre>
  
  <p>Now I want to print content in the TinyMCE's editor, after you click the <code>submit</code> button.</p>
  
  <p>The dump.php</p>
  
  <pre><code>&lt;?php
      print_r($_POST);
  ?&gt;
  </code></pre>
  
  <p>Why nothing  print by dump.php?<br>
  I can send info to the dump.php via AJAX method.<br>
  1.Remove <code>&lt;form method="post" action="dump.php"&gt;&lt;/form&gt;</code> in html part.<br>
  2.Add the following js code in the JavaScript part.    </p>
  
  <pre><code>&lt;script&gt;
  function send(){
      var data = tinyMCE.get('mytextarea').getContent();
      var ajax = new XMLHttpRequest();
      ajax.open('POST','dump.php',false);
      ajax.setRequestHeader('Content-type','application/x-www-form-urlencoded');
      ajax.send('data='+data);    
  } 
  ob = document.getElementById("submit");
  ob.addEventListener("click",send);
  &lt;/script&gt;
  </code></pre>
  
  <p>I have tried that it can pass  content which I type in the <code>textarea</code> whose <code>id</code> is <code>mytextarea</code> to <code>dump.php</code> and <code>dump.php</code> can print the array properly.</p>
  
  <p>My issue is how to pass content in TinyMCE's <code>textarea</code> to a PHP file directly instead of sending it via AJAX?
  Do the work without AJAX.</p>