I can't for the life of me work out why I'm getting an HTTP 500 Error when submitting my form. I've managed to narrow it down to my PHP date formatting. But I can't seem to find the bug, I know it lies here as I've trailed and errored the entire post function commenting out function by function until the form posted.
Which has led me here:
$db_responseDate = $_POST['responseDate'];
$date2 = DateTime::createFromFormat('Y-m-d', $db_responseDate);
$db_responseDate = $date2->format('d/m/Y');
My HTML input is as follows:
<label for="responseDate">Response Date:</label>
<input type="date" class="form-control" id="responseDate" name="responseDate">
If anyone can shed some light on where I'm going wrong here, I'd really appreciate it. Thanks in advance.