I tried asking this question earlier but I had a prior problem of properly obtaining textual month, day and year date from an input field in an HTML table.
Now that I have obtained this string data, in this case "Aug 25, 2014", I want to convert into date data that will eventually be inserted into a MySQL table.
PHP:
$todays_date = strtotime("today");
echo "<form name='timesubmit" . $time_cell_row . "' action='enter_time.php?action=timesubmit" .$time_cell_row . "' method='POST'>";
echo "<table>"
echo "<th><input name='daycell1' type='text' value='$FormattedCurrDate' readonly/></th>";
echo "</table>";
echo "</form>";
/* Code in place to GET action from URL
*/
$date1 = $_POST['daycell1'];
echo "Date from input field: " . $date1; // displays "Aug 25, 2014
How do I take the variable '$date1' and convert it into a date format so that it can be inserted into a MySQL table with a field of type "date"?