How to send a post request to a specific url, so that along with the sent request the user is on the page to which the request was sent?
While there is such code:
$postdata = http_build_query( array( 'shopId' => $user->Shop->shop_id, 'scid' => $user->Shop->sc_id, 'CustomerNumber' => $user->id, 'sum' => $pay->sum, 'orderNumber' => $pay->id, 'cps_phone' => '79110000000', 'cps_email' => 'user@domain.com', 'paymentType' => $_POST['paymentType'], // //PC - Со счета в Яндекс.Деньгах (яндекс кошелек) // 'paymentType' => 'PC', // //AC - С банковской карты // 'paymentType' => 'AC', ) ); $opts = array('http' => array( 'method' => 'POST', // 'header' => 'Content-type: application/x-www-form-urlencoded', 'content' => $postdata ) ); $context = stream_context_create($opts); $result = file_get_contents('http://example.com/submit.php', false, $context);
This code supposedly works))
Only he gets the answer to the $results
variable, and it’s necessary that the user goes to this page along with the request.