$_SERVER['HTTP_REFERER']
!==document.referrer
if (!isset($_COOKIE['referrer']) && (!isset($_SERVER['HTTP_CACHE_CONTROL']) || $_SERVER['HTTP_CACHE_CONTROL'] !== 'max-age=0')) {
$previousPageUrl = $_SERVER['HTTP_REFERER'] . $_SERVER['REQUEST_URI'];
setcookie('referrer', $previousPageUrl, time() + 3600, '/');
header('Location: ' . $previousPageUrl);
exit;
}
let elements = document.querySelectorAll('.right-form-calculator__cost');
const totalSum = [...elements].reduce((sum, current) => {
return sum + parseFloat(current.innerText);
}, 0);
let calculator__sum = document.querySelector('.right-form-calculator__sum');
calculator__sum.innerHTML = 'Сумма '+totalSum+' руб'