Php Curl adding Params

后端 未结 3 861
清歌不尽
清歌不尽 2020-12-31 01:41

Im a newbie im trying to get a script to trigger another script with Curl in PHP but it dosent seem to be sending the paramaters.

Is there a seperate function to app

3条回答
  •  执笔经年
    2020-12-31 02:23

    you need set CURLOPT_POST as true and CURLOPT_POSTFIELDS => parameters

      curl_setopt($ch, CURLOPT_POST, true); 
       curl_setopt($ch, CURLOPT_POSTFIELDS, $parameters);
    

    a suggestion,set 'CURLOPT_RETURNTRANSFER', as true to return the transfer as a string of the return value of curl_exec($ch) instead of outputting it out directly

提交回复
热议问题