I have a simple script that curls into a site to get flight information. The site has input for departure city, arrival city, and date. The date field on the actual site uses datepicker with a placeholder format as mm/dd/yyyy, and when a date is selected with date picker the date input field populates with something like 04/14/2019.
My script includes:
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "http://www.somesite.com");
$curl_data = "dep=YYY&arr=ZZZ&date=04/14/2019";
curl_setopt($ch, CURLOPT_POST, true);
curl_setopt($ch, CURLOPT_POSTFIELDS, $curl_data);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$output = curl_exec($ch);
curl_close($ch);
When I echo the output, it always tell me that I submitted an invalid date. I've tried multiple formats. Any ideas on how to determine the proper date format or what else I might need to do?
Thanks.