Есть обработчик:
$(document).delegate('#fakeButton', 'click', function() {
var url = 'index.php?route=checkout/guest/freetimes';
$('#timeselect').load(url, {'date': $('#input-payment-orderdate').val()});
});
и функция в php:
function freetimes() {
$myCurl = curl_init();
$date = $_POST('date');
curl_setopt_array($myCurl, array(
CURLOPT_URL => "http://localhost:56987/api/orders/freetimes?date=".$date,
CURLOPT_RETURNTRANSFER => true
));
$response = curl_exec($myCurl);
curl_close($myCurl);
$times = array();
$times[] = split("/", str_replace("\"","",$response));
$rez = '';
$max = sizeof($times[0]);
for ($i = 0; $i < $max; $i++) {
list($value, $start, $end) = split('-', $times[0][$i]);
$rez = $rez.'<option value="'.$value.'">'.$start.'-'.$end.'</option>';
}
echo $rez;
}
Функция php полностью рабочая и с $date = date("Y-n-j") работает замечательно, но при попытке принять параметры методом POST вылетает
Не знаю как исправить