F
F
fStrange2019-03-05 00:46:09
1C-Bitrix
fStrange, 2019-03-05 00:46:09

$_POST in component_epilog.php not available?

I have a custom component.
I want to write, let's say, in $_SESSION or in $arResult data from a POST request.
In the example I see this
in component_epilog.php

<? 
     $_SESSION['g-recaptcha-response'] = '';
  if ($_POST['g-recaptcha-response']) {
    $_SESSION['g-recaptcha-response'] = htmlspecialcharsbx(substr($_POST['g-recaptcha-response'], 0, 3000));
  } 
  dbg2f($_POST);
?>

The dbg2f() function simply writes the contents of the variable to the file. Empty
Similarly, if I write in result_modifier.php
I can get $_POST content only in component.php.
It doesn't really matter to me, but I would like to understand.
In several examples, I saw in component_epilog.php the entry from $_POST to the session.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Roman Gritsuk, 2019-03-05
@winer

In component_epilog.php $_POST and other superglobals are available.
https://dev.1c-bitrix.ru/learning/course/index.php... Is
the component with component_epilog.php called, by chance, not in the template of another component (template.php or result_modifier.php )?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question