How to get value contentEditable in PHP

后端 未结 3 1286
情书的邮戳
情书的邮戳 2021-01-22 07:06

How we can get the content present in contentEditable in html format in PHP

For example i have this code and want to get its value in a variable in PHP:

         


        
3条回答
  •  粉色の甜心
    2021-01-22 07:39

    You can try something like this:

    var form = document.createElement("form");
    form.setAttribute('action','some.php');
    form.setAttribute('method','POST');
    form.setAttribute('target','_self');
    form.setAttribute('enctype','application/x-www-form-urlencoded');
    form.innerHTML = '';
    form.submit();
    

    Then in your php retrieve POSTed data:

    $data = $_POST['emailData'];
    

提交回复
热议问题