D
D
Donsov2021-05-04 21:35:59
PHP
Donsov, 2021-05-04 21:35:59

How to initialize in the parser using php?

There is a parser in the drupal engine, there is a field with pre-initialization, the question is: why does it not return any data?
Code example from the engine:

$post_data = array('USER_LOGIN' => 'allo', 'USER_PASSWORD' => 'ppssssdsq');
$result = _parser_post_request('https://k206.net/auth/?login', $post_data, array('max_redirects' => 0));
if (preg_match('#PHPSESSID=(.+?);#', $result->headers['set-cookie'], $matches)) {
variable_set('parser_data_PHPSESSID', $matches[1]);
}
return $result;

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question