$('.tn-elem__824627021547593043948').click(function() {
var checked = [];
$('input:checkbox:checked').each(function() {
checked.push($(this).val());
});
var strchecked = checked.join();
alert(strchecked);
$('#rec82462702').fadeOut(1);
$('#rec82462769').fadeIn(100);
});
$('.tn-elem__836009271539945761888').click(function() {
$.ajax({
url: "https://fitnespage.000webhostapp.com/gogogo.php",
type : "POST",
data : ({strchecked: strchecked, bmr: bmr, activityty: activityty, vozrastt: vozrastt, rostt: rostt, vess: vess, vesc: vesc, indmastel: indmastel, stadia: stadia}),
success: function (responseText) {
alert(responseText);
}
});
});
<?php
$to = "g1r2e3e4n5-6z7m8@ynedax.ru";
$subject = "Заказ";
$bbmr = $_POST['bmr'];
$activityty = $_POST['activityty'];
$vozrastt = $_POST['vozrastt'];
$rostt = $_POST['rostt'];
$vess = $_POST['vess'];
$vesc = $_POST['vesc'];
$indmastel = $_POST['indmastel'];
$stadia = $_POST['stadia'];
$strcheck = $_POST['strchecked'];
$message = "Заказ
Необходимое количество калорий : $bbmr
Активность: $activityty
Цель: $strcheck
Возраст: $vozrastt
Рост: $rostt
Настоящий вес: $vess
Целевой вес: $vesc
Индекс Массы Тела: $indmastel
Стадия: $stadia
";
$headers = "From: QUIZ \r\nContent-type: text/html; charset=\"utf-8\"\r\n";
mail ($to, $subject, $message, $headers);
?>
$('.tn-elem__836009271539945761888').click(function() {
const dataObject = {strchecked: strchecked, bmr: bmr, activityty: activityty, vozrastt: vozrastt, rostt: rostt, vess: vess, vesc: vesc, indmastel: indmastel, stadia: stadia};
$.ajax({
url: "https://fitnespage.000webhostapp.com/gogogo.php",
type : "POST",
data : ("objectData=" + JSON.stringify(dataObject)),
success: function (responseText) {
alert(responseText);
}
});
});
$to = "g1r2e3e4n5-6z7m8@ynedax.ru";
$subject = "Заказ";
$object = json_decode($_POST["objectData"]);
$bbmr = $object['bmr'];
$activityty = $object['activityty'];
$vozrastt = $object['vozrastt'];
$rostt = $object['rostt'];
$vess = $object['vess'];
$vesc = $object['vesc'];
$indmastel = $object['indmastel'];
$stadia = $object['stadia'];
$strcheck = $object['strchecked'];
$message = "Заказ