There is a handler:
$(document).delegate('#fakeButton', 'click', function() { var url = 'index.php?route=checkout/guest/freetimes'; $('#timeselect').load(url, {'date': $('#input-payment-orderdate').val()}); }); and function in 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; } The php function is fully working and with $ date = date ("Ynj") works great, but when you try to accept parameters using the POST method, it crashes.
I do not know how to fix