Обновлено
Пожалуйста, запустите этот обновленный код и опубликуйте результаты:
<code>$postData = array(
'data' => Yii::$app->request->post('data'),
'mac' => Yii::$app->request->post('mac'),
'ksn' => '1'
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 6.2; WOW64; rv:17.0) Gecko/20100101 Firefox/17.0');
curl_setopt($ch,CURLOPT_URL, Yii::$app->request->post('url'));
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, $postData);
curl_setopt($ch, CURLOPT_SSLVERSION, 6);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLINFO_HEADER_OUT, 1); //Add this line so we can grab the headers that were sent with your request.
curl_setopt($ch, CURLOPT_FAILONERROR, 1); //Helps with http errors.
curl_setopt($ch, CURLOPT_VERBOSE, 1); //This shows the response headers in the response.
curl_setopt($ch, CURLOPT_HEADER, 1); //Oppps
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
if(curl_exec($ch) === false){
echo 'There was an error with your request.<br>';
echo 'Here are the curl errors:<br>';
echo curl_error($ch) . '<br><br>';
}else{
echo 'There were no errors with the request.<br>';
$result = curl_exec($ch);
echo $result;
}
//Get your sent headers:
$info = curl_getinfo($ch);
echo '<pre>';
echo 'Here are the headers that you sent:<br>';
print_r($info);
echo '
';
curl_close ($ ч);
вернуть $ результат;