Redirect with POST data

前端 未结 4 2031
野的像风
野的像风 2020-12-19 18:55

I am working on a shopping cart with several payment options using different APIs.

The flow I want is that the user chooses which payment option to use and the accor

4条回答
  •  甜味超标
    2020-12-19 19:09

    Try this

            $context = stream_context_create(array(
            'http' => array(
              'method'  => 'POST',
              'header'  => "Content-type: application/x-www-form-urlencoded\r\n",
              'content' => http_build_query($_POST)
            ),
          )); 
    
        echo file_get_contents($url, false, $context);
    

提交回复
热议问题