<?
$myCurl = curl_init();
$post_paramm = array();
foreach ($_POST as $param_name => $param_val) {
$post_paramm[$param_name] = $param_val;
}
curl_setopt($myCurl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($myCurl, CURLOPT_HEADER, true);
$header[] = "Connection: keep-alive";
$header[] = "Pragma: no-cache";
$header[] = "Cache-Control: no-cache";
$header[] = "Upgrade-Insecure-Requests: 1";
$header[] = "User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:51.0) Gecko/20100101 Firefox/51.0";
$header[] = "Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8";
$header[] = "Accept-Encoding: gzip, deflate";
$header[] = "Accept-Language: ru-RU,ru;q=0.8,en-US;q=0.5,en;q=0.3";
curl_setopt($myCurl, CURLOPT_HTTPHEADER, $header);
curl_setopt_array($myCurl, array(
CURLOPT_URL => 'https://polikarbonates.com/spk_calc_old.php',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => http_build_query($post_paramm)
));
// Проверяем наличие ошибок
if (!curl_errno($myCurl)) {
$info = curl_getinfo($myCurl);
echo 'Прошло ', $info['total_time'], ' секунд во время запроса к ', $info['url'], "\n";
}
$response = curl_exec($myCurl);
curl_close($myCurl);
echo $response;
?>