There are 2 sites from the first one you need to send an array of POST, and on the second one you accept and process it, I do this: On the site " http://test1.com " I send the POST data to " http://test2.com " by this method
$url = 'http://test2.com'; $params = array( 'data_send' => $data_send, //$_POST['data_send'] ); file_get_contents($url, false, stream_context_create(array( 'http' => array( 'method' => 'POST', 'header' => 'Content-type: application/x-www-form-urlencoded', 'content' => http_build_query($params) ) ))); On " http://test2.com " in the topic function.php I accept:
if(isset($_POST['data_send'])){ var_dump($_POST['data_send']);} But there is nothing, on pure PHP such an example worked for me, can someone tell me how to do this correctly on wordpress