What are these parameters in POST?

When I click on the "save" button, a request is sent to the server , this is an email from the Tinymce editor with pictures. The parameters{[5] are passed to the server at this point]}

-----------------------------28257400717280
Content-Disposition: form-data; name="act"

save_tmp
-----------------------------28257400717280
Content-Disposition: form-data; name="headers"

1|1|1
-----------------------------28257400717280
Content-Disposition: form-data; name="mail_body"

<p><img src="\&quot;file.1.png\&quot;" /><img src="\&quot;\\&quot;file.1.png\\&quot;\&quot;" /><img src="\&quot;\\&quot;\\\\&quot;\\\\\\\\&quot;\\\\\\\\\\\\\\\\&quot;file.1.png\\\\\\\\\\\\\\\\&quot;\\\\\\\\&quot;\\\\&quot;\\&quot;\&quot;" /><img src="\&quot;\\&quot;\\\\&quot;\\\\\\\\&quot;file.1.png\\\\\\\\&quot;\\\\&quot;\\&quot;\&quot;" /><img src="\&quot;\\&quot;\\\\&quot;file.1.png\\\\&quot;\\&quot;\&quot;" /></p>
-----------------------------28257400717280
Content-Disposition: form-data; name="attach"

-----------------------------28257400717280
Content-Disposition: form-data; name="hdir"

17.05.2018
-----------------------------28257400717280--

What are these parameters? and most importantly, how to fix them. near the file name, " and slashes are constantly substituted, I need to remove them so that it is

     <img src="file.1.jpg"> 

What? what line to look for in the scripts?

Here is the form

<form id="mce" name="mce">

               <table id="mheader" cellspacing="0" cellpadding="0"><tbody><tr><td id="msubj">
                Тема письма<br>
                <input id="msubj" type="text">
            </td><td id="mfromtxt">
                От кого<br>
                <input id="mfromtxt" type="text">
            </td><td id="mfrommail">
                E-mail отправителя<br>
                <input id="mfrommail" type="text">
            </td></tr></tbody></table>

            <div id="mceu_23" class="mce-tinymce mce-container mce-panel" hidefocus="1" tabindex="-1" role="application" style="visibility: hidden; border-width: 1px;"><div id="mceu_23-body" class="mce-container-body mce-stack-layout"><div id="mceu_24" class="mce-toolbar-grp mce-container mce-panel mce-stack-layout-item mce-first" hidefocus="1" tabindex="-1" role="group"><div id="mceu_24-body" class="mce-container-body mce-stack-layout"><div id="mceu_25" class="mce-container mce-toolbar mce-stack-layout-item mce-first" role="toolbar"><div id="mceu_25-body" class="mce-container-body mce-flow-layout"><div id="mceu_26" class="mce-container mce-flow-layout-item mce-first mce-btn-group" role="group"><div id="mceu_26-body"><div id="mceu_0" class="mce-widget mce-btn mce-first" tabindex="-1" aria-labelledby="mceu_0" role="button" aria-label="Source code"><button role="presentation" type="button" tabindex="-1"><i class="mce-ico mce-i-code"></i></button></div><div id="mceu_1" class="mce-widget mce-btn mce-last" tabindex="-1" aria-labelledby="mceu_1" role="button" aria-label="Preview"><button role="presentation" type="button" tabindex="-1"><i class="mce-ico mce-i-preview"></i></button></div></div></div><div id="mceu_27" class="mce-container mce-flow-layout-item mce-btn-group" role="group"><div id="mceu_27-body"><div id="mceu_2" class="mce-widget mce-btn mce-menubtn mce-first mce-btn-has-text" tabindex="-1" aria-labelledby="mceu_2" role="button" aria-haspopup="true"><button id="mceu_2-open" role="presentation" type="button" tabindex="-1"><span class="mce-txt">Формат</span> <i class="mce-caret"></i></button></div><div id="mceu_3" class="mce-widget mce-btn mce-menubtn mce-fixed-width mce-listbox mce-btn-has-text" tabindex="-1" aria-labelledby="mceu_3" role="button" aria-label="Font Sizes" aria-haspopup="true"><button id="mceu_3-open" role="presentation" type="button" tabindex="-1"><span class="mce-txt">Размер шрифта</span> <i class="mce-caret"></i></button></div><div id="mceu_4" class="mce-widget mce-btn mce-menubtn mce-fixed-width mce-listbox mce-last mce-btn-has-text" tabindex="-1" aria-labelledby="mceu_4" role="button" aria-label="Font Family" aria-haspopup="true"><button id="mceu_4-open" role="presentation" type="button" tabindex="-1"><span class="mce-txt">Шрифт</span> <i class="mce-caret"></i></button></div></div></div><div id="mceu_28" class="mce-container mce-flow-layout-item mce-last mce-btn-group" role="group"><div id="mceu_28-body"><div id="mceu_5" class="mce-widget mce-btn mce-first" tabindex="-1" aria-labelledby="mceu_5" role="button" aria-label="Horizontal line"><button role="presentation" type="button" tabindex="-1"><i class="mce-ico mce-i-hr"></i></button></div><div id="mceu_6" class="mce-widget mce-btn mce-menubtn" tabindex="-1" aria-labelledby="mceu_6" role="button" aria-label="Table" aria-haspopup="true"><button id="mceu_6-open" role="presentation" type="button" tabindex="-1"><i class="mce-ico mce-i-table"></i> <i class="mce-caret"></i></button></div><div id="mceu_7" class="mce-widget mce-btn" tabindex="-1" aria-labelledby="mceu_7" role="button" aria-label="Insert/edit link"><button role="presentation" type="button" tabindex="-1"><i class="mce-ico mce-i-link"></i></button></div><div id="mceu_8" class="mce-widget mce-btn" tabindex="-1" aria-labelledby="mceu_8" role="button" aria-label="Remove link"><button role="presentation" type="button" tabindex="-1"><i class="mce-ico mce-i-unlink"></i></button></div><div id="mceu_9" class="mce-widget mce-btn mce-last" tabindex="-1" aria-labelledby="mceu_9" role="button" aria-label="Insert/edit image"><button role="presentation" type="button" tabindex="-1"><i class="mce-ico mce-i-image"></i></button></div></div></div></div></div><div id="mceu_29" class="mce-container mce-toolbar mce-stack-layout-item mce-last" role="toolbar"><div id="mceu_29-body" class="mce-container-body mce-flow-layout"><div id="mceu_30" class="mce-container mce-flow-layout-item mce-first mce-btn-group" role="group"><div id="mceu_30-body"><div id="mceu_10" class="mce-widget mce-btn mce-first" tabindex="-1" aria-labelledby="mceu_10" role="button" aria-label="Clear formatting"><button role="presentation" type="button" tabindex="-1"><i class="mce-ico mce-i-removeformat"></i></button></div><div id="mceu_11" class="mce-widget mce-btn" tabindex="-1" aria-labelledby="mceu_11" role="button" aria-label="Bold"><button role="presentation" type="button" tabindex="-1"><i class="mce-ico mce-i-bold"></i></button></div><div id="mceu_12" class="mce-widget mce-btn" tabindex="-1" aria-labelledby="mceu_12" role="button" aria-label="Italic"><button role="presentation" type="button" tabindex="-1"><i class="mce-ico mce-i-italic"></i></button></div><div id="mceu_13" class="mce-widget mce-btn mce-colorbutton" role="button" tabindex="-1" aria-haspopup="true" aria-label="Text color"><button role="presentation" hidefocus="1" type="button" tabindex="-1"><i class="mce-ico mce-i-forecolor"></i><span id="mceu_13-preview" class="mce-preview"></span></button><button type="button" class="mce-open" hidefocus="1" tabindex="-1"> <i class="mce-caret"></i></button></div><div id="mceu_14" class="mce-widget mce-btn mce-colorbutton mce-last" role="button" tabindex="-1" aria-haspopup="true" aria-label="Background color"><button role="presentation" hidefocus="1" type="button" tabindex="-1"><i class="mce-ico mce-i-backcolor"></i><span id="mceu_14-preview" class="mce-preview"></span></button><button type="button" class="mce-open" hidefocus="1" tabindex="-1"> <i class="mce-caret"></i></button></div></div></div><div id="mceu_31" class="mce-container mce-flow-layout-item mce-btn-group" role="group"><div id="mceu_31-body"><div id="mceu_15" class="mce-widget mce-btn mce-first" tabindex="-1" aria-labelledby="mceu_15" role="button" aria-label="Align left"><button role="presentation" type="button" tabindex="-1"><i class="mce-ico mce-i-alignleft"></i></button></div><div id="mceu_16" class="mce-widget mce-btn" tabindex="-1" aria-labelledby="mceu_16" role="button" aria-label="Align center"><button role="presentation" type="button" tabindex="-1"><i class="mce-ico mce-i-aligncenter"></i></button></div><div id="mceu_17" class="mce-widget mce-btn" tabindex="-1" aria-labelledby="mceu_17" role="button" aria-label="Align right"><button role="presentation" type="button" tabindex="-1"><i class="mce-ico mce-i-alignright"></i></button></div><div id="mceu_18" class="mce-widget mce-btn mce-last" tabindex="-1" aria-labelledby="mceu_18" role="button" aria-label="Justify"><button role="presentation" type="button" tabindex="-1"><i class="mce-ico mce-i-alignjustify"></i></button></div></div></div><div id="mceu_32" class="mce-container mce-flow-layout-item mce-btn-group" role="group"><div id="mceu_32-body"><div id="mceu_19" class="mce-widget mce-btn mce-splitbtn mce-menubtn mce-first" role="button" tabindex="-1" aria-label="Bullet list" aria-haspopup="true"><button type="button" hidefocus="1" tabindex="-1"><i class="mce-ico mce-i-bullist"></i></button><button type="button" class="mce-open" hidefocus="1" tabindex="-1"> <i class="mce-caret"></i></button></div><div id="mceu_20" class="mce-widget mce-btn mce-splitbtn mce-menubtn mce-last" role="button" tabindex="-1" aria-label="Numbered list" aria-haspopup="true"><button type="button" hidefocus="1" tabindex="-1"><i class="mce-ico mce-i-numlist"></i></button><button type="button" class="mce-open" hidefocus="1" tabindex="-1"> <i class="mce-caret"></i></button></div></div></div><div id="mceu_33" class="mce-container mce-flow-layout-item mce-last mce-btn-group" role="group"><div id="mceu_33-body"><div id="mceu_21" class="mce-widget mce-btn mce-first" tabindex="-1" aria-labelledby="mceu_21" role="button" aria-label="Decrease indent"><button role="presentation" type="button" tabindex="-1"><i class="mce-ico mce-i-outdent"></i></button></div><div id="mceu_22" class="mce-widget mce-btn mce-last" tabindex="-1" aria-labelledby="mceu_22" role="button" aria-label="Increase indent"><button role="presentation" type="button" tabindex="-1"><i class="mce-ico mce-i-indent"></i></button></div></div></div></div></div></div></div><div id="mceu_34" class="mce-edit-area mce-container mce-panel mce-stack-layout-item" hidefocus="1" tabindex="-1" role="group" style="border-width: 1px 0px 0px;"><iframe id="mce_0_ifr" allowtransparency="true" title="Текстовое поле. Нажмите ALT-F9 чтобы вызвать меню, ALT-F10 панель инструментов, ALT-0 для вызова помощи." style="width: 100%; height: 300px; display: block;" src="javascript:&quot;&quot;" frameborder="0"></iframe></div><div id="mceu_35" class="mce-statusbar mce-container mce-panel mce-stack-layout-item mce-last" hidefocus="1" tabindex="-1" role="group" style="border-width: 1px 0px 0px;"><div id="mceu_35-body" class="mce-container-body mce-flow-layout"><div id="mceu_36" class="mce-path mce-flow-layout-item mce-first"><div role="button" class="mce-path-item mce-last" data-index="0" tabindex="-1" id="mceu_36-0" aria-level="0">p</div></div><div id="mceu_37" class="mce-flow-layout-item mce-last mce-resizehandle"><i class="mce-ico mce-i-resize"></i></div></div></div></div></div><textarea id="mce_0" style="display: none;" aria-hidden="true"></textarea>

            <div id="mfiles"><span id="mfile"><span id="mfile_name" onclick="in_to(&quot;file.1.png&quot;)">file.1.png</span><a href="javascript:void(0);" onclick="fdel(&quot;file.1.png&quot;,&quot;delete&quot;);" title="Удалить">Х</a><input id="mfile_name" title="Прикрепить" value="file.1.png" type="checkbox"></span></div>

            <table width="100%" cellspacing="0" cellpadding="0"><tbody><tr><td width="50%">
                <input id="mfile" class="upload" accept=".doc,.pdf,.docx,.txt,.png,image/*" type="file">
            </td><td style="text-align: right;">
                <input id="mfile" class="save" value="Сохранить" type="button">&nbsp;&nbsp;&nbsp;
            </td><td style="text-align: right;">
                <input id="mfile" class="ready" value="Готово" type="button">
            </td></tr></tbody></table>

        </form>

Here is var_dump ($_POST) by clicking on the{[5] button]}

array(5) { ["act"]=> string(8) "save_tmp" ["headers"]=> string(59)     "Тестовое письмо|[email protected]|[email protected]" ["mail_body"]=> string(34) "
1" ["attach"]=> string(0) "" ["hdir"]=> string(10) "17.05.2018" }
Author: Dmitriy, 2018-05-17

1 answers

Post request types. There are at least 3 (three) types of data encoding in a post request. In your case, I will specify your type first. The post request type can be specified in the <form enctype='multipart/form-data'> tag, for example, then the browser generates the request. If you write your own client, then you will have to form a request with a structure characteristic of this type of POST request.

  • Multipart/form-data it looks like this.

    POST / HTTP/1.1
    Host: 127.0.0.1:8080
    Accept: */*
    Content-Length: 256
    Expect: 100-continue
    Content-Type: multipart/form-data; boundary=------------------------  5e95fe2dd0851b9a
    
    --------------------------5e95fe2dd0851b9a
    Content-Disposition: form-data; name="widgetId"
    
    messager
    --------------------------5e95fe2dd0851b9a
    

    The request took here for an example. this kind of request is often it is used because it can be used to send files to the server. Other types of requests cannot transfer files (because the file may be distorted). boundary= specifies a long delimiter, which avoids "ambiguity". The browser transmits the data in its pure form (without using urlencoding or "escape-ing"). That is, this method of transmission does not distort the data at all.

  • Application/x-www-form-urlencoded Passing parameters as url-encoded, i.e. the request has view

    POST / HTTP/1.1
    Host: 127.0.0.1:8080
    Accept: */*
    Content-Length: 28
    
    param1=value&param2=value%2F
    

    That is, as in a get request without a question mark, service characters are encoded with%. That is, the data passes urlencode (or escape is deprecated). In rare cases, there may be encoding problems if the urlencode code page is 1251 on the client, and the server is waiting for UTF-8. This type of request transmission will seem very familiar to you. If you want to switch to this type, specify <from enctype='application/x-www-form-urlencoded' in the form parameters.

  • Text/plain Spaces are replaced the + sign, letters, and other characters are not encoded. I have not encountered the use of this method.

  • Text/json The request content is passed as JSON. this is a relatively new type. I can't say about the support. this method is used, especially for exchanging "subqueries", such as ajax. This method cannot pass a file, and if you encode it in base64, then... the text is passed.

If you use php c# or other web programming languages-y when preparing a request, the data from the "content" itself is rewritten into variables, and as a rule, it can be obtained via $_POST(php) Request(c#). File functions are used to get files. The environment itself Content-Type sees the request type and decodes it.

For php, you just need to write $_POST["act"] and you will get save_tmp.

 0
Author: nick_n_a, 2018-06-15 09:37:05