When you go to the page there is a hidden input field in which there is already some value. The question is how to get it before submitting the form? maybe something like regular expressions?

here is this field:

<input type="hidden" name="_csrf-backend" value="ั‚ัƒั‚-ั‚ะตะบัั‚"> 

I need only here-text

I would be grateful for the help.

PS you need only php tools, given that this input field is inserted into the page markup, that is, not one line with this field, but the whole page, where there are other fields ...

    2 answers 2

    You can consider this option:

     $string = '<input type="hidden" name="_csrf-backend" value="ั‚ัƒั‚-ั‚ะตะบัั‚">'; preg_match_all('~"_csrf-backend"\svalue="(.*?)">~', $string, $matches); print_r($matches[1]); 

    At the output we get:

     Array ( [0] => ั‚ัƒั‚-ั‚ะตะบัั‚ ) 

      I do not quite understand why it is impossible to identify the value on the client through js?

      If it comes in handy then the code is below:
      js document.querySelector("input[name='_csrf-backend']").value
      JQuery $("input[name='_csrf-backend']").val();