Я отправляю значение в файл php
с AJAX
.
. У меня есть эта функция в jQuery
:
// Service select change
$container.on('change', '.bookly-js-select-service', function() {
var gekozen_behandeling = this.value;
$.ajax({
type: 'POST',
url: '/behandeling.php',
data: {
behandeling_nieuw: gekozen_behandeling
},
dataType: 'html',
success: function(response) {
console.log(response);
}
});
});
. После этого оповещения завершены.
В моем файле behandeling.php
код такой:
<code><?php
session_start();
$_SESSION["type_behandeling"] = $_POST["behandeling_nieuw"];
echo '<pre>' . print_r($_SESSION, TRUE) . '
'; ?>
После этого и перехода к файлу behandeling.php
session variable
по-прежнему пуст.
<code><pre>Array
(
[bookly] => Array
(
[forms] => Array
(
[5e1c6d8916b27] => Array
(
[defaults] => Array
(
[service_id] => 0
[staff_id] => 0
[location_id] => 0
[category_id] => 5
)
[last_touched] => 1578921357
[data] => Array
(
[first_rendered_step] => 1
[time_zone] =>
[time_zone_offset] =>
[date_from] => 2020-01-13
[days] =>
[time_from] => 09:00
[time_to] => 21:00
[slots] => Array
(
)
[facebook_id] =>
[full_name] =>
[first_name] =>
[last_name] =>
[email] =>
[email_confirm] =>
[phone] =>
[birthday] =>
[additional_address] =>
[country] =>
[state] =>
[postcode] =>
[city] =>
[street] =>
[street_number] =>
[address_iso] => Array
(
)
[notes] =>
[info_fields] => Array
(
)
[coupon_code] =>
[deposit_full] => 0
[edit_cart_keys] => Array
(
)
[repeated] => 0
[repeat_data] => Array
(
)
)
[cart] => Array
(
)
[chain] => Array
(
[0] => Array
(
[service_id] =>
[staff_ids] => Array
(
)
[number_of_persons] =>
[quantity] =>
[extras] => Array
(
)
[custom_fields] => Array
(
)
[location_id] =>
[series_unique_id] => 0
[first_in_series] =>
[units] => 1
)
)
[booking_numbers] => Array
(
)
[payment_id] =>
[payment_type] => local
)
[5e1c6dc0324c7] => Array
(
[defaults] => Array
(
[service_id] => 0
[staff_id] => 0
[location_id] => 0
[category_id] => 5
)
[last_touched] => 1578921411
[data] => Array
(
[first_rendered_step] => 1
[time_zone] =>
[time_zone_offset] =>
[date_from] => 2020-01-13
[days] =>
[time_from] => 09:00
[time_to] => 21:00
[slots] => Array
(
)
[facebook_id] =>
[full_name] =>
[first_name] =>
[last_name] =>
[email] =>
[email_confirm] =>
[phone] =>
[birthday] =>
[additional_address] =>
[country] =>
[state] =>
[postcode] =>
[city] =>
[street] =>
[street_number] =>
[address_iso] => Array
(
)
[notes] =>
[info_fields] => Array
(
)
[coupon_code] =>
[deposit_full] => 0
[edit_cart_keys] => Array
(
)
[repeated] => 0
[repeat_data] => Array
(
)
)
[cart] => Array
(
)
[chain] => Array
(
[0] => Array
(
[service_id] =>
[staff_ids] => Array
(
)
[number_of_persons] =>
[quantity] =>
[extras] => Array
(
)
[custom_fields] => Array
(
)
[location_id] =>
[series_unique_id] => 0
[first_in_series] =>
[units] => 1
)
)
[booking_numbers] => Array
(
)
[payment_id] =>
[payment_type] => local
)
[5e1c6df9da30f] => Array
(
[defaults] => Array
(
[service_id] => 0
[staff_id] => 0
[location_id] => 0
[category_id] => 5
)
[last_touched] => 1578921468
[data] => Array
(
[first_rendered_step] => 1
[time_zone] =>
[time_zone_offset] =>
[date_from] => 2020-01-13
[days] =>
[time_from] => 09:00
[time_to] => 21:00
[slots] => Array
(
)
[facebook_id] =>
[full_name] =>
[first_name] =>
[last_name] =>
[email] =>
[email_confirm] =>
[phone] =>
[birthday] =>
[additional_address] =>
[country] =>
[state] =>
[postcode] =>
[city] =>
[street] =>
[street_number] =>
[address_iso] => Array
(
)
[notes] =>
[info_fields] => Array
(
)
[coupon_code] =>
[deposit_full] => 0
[edit_cart_keys] => Array
(
)
[repeated] => 0
[repeat_data] => Array
(
)
)
[cart] => Array
(
)
[chain] => Array
(
[0] => Array
(
[service_id] =>
[staff_ids] => Array
(
)
[number_of_persons] =>
[quantity] =>
[extras] => Array
(
)
[custom_fields] => Array
(
)
[location_id] =>
[series_unique_id] => 0
[first_in_series] =>
[units] => 1
)
)
[booking_numbers] => Array
(
)
[payment_id] =>
[payment_type] => local
)
[5e1c6e0f76ddd] => Array
(
[defaults] => Array
(
[service_id] => 0
[staff_id] => 0
[location_id] => 0
[category_id] => 5
)
[last_touched] => 1578921490
[data] => Array
(
[first_rendered_step] => 1
[time_zone] =>
[time_zone_offset] =>
[date_from] => 2020-01-13
[days] =>
[time_from] => 09:00
[time_to] => 21:00
[slots] => Array
(
)
[facebook_id] =>
[full_name] =>
[first_name] =>
[last_name] =>
[email] =>
[email_confirm] =>
[phone] =>
[birthday] =>
[additional_address] =>
[country] =>
[state] =>
[postcode] =>
[city] =>
[street] =>
[street_number] =>
[address_iso] => Array
(
)
[notes] =>
[info_fields] => Array
(
)
[coupon_code] =>
[deposit_full] => 0
[edit_cart_keys] => Array
(
)
[repeated] => 0
[repeat_data] => Array
(
)
)
[cart] => Array
(
)
[chain] => Array
(
[0] => Array
(
[service_id] =>
[staff_ids] => Array
(
)
[number_of_persons] =>
[quantity] =>
[extras] => Array
(
)
[custom_fields] => Array
(
)
[location_id] =>
[series_unique_id] => 0
[first_in_series] =>
[units] => 1
)
)
[booking_numbers] => Array
(
)
[payment_id] =>
[payment_type] => local
)
)
)
[type_behandeling] => 51
)