php - Converting String into Date from HTML Form -
i collect date formats :
day
<select id="dobday" name = "dobday" class="pure-input-1-4"> <option>date of birth day</option> <option value="01">01</option>
month
<select id="dobmonth" name = "dobmonth" class="pure-input-1-4"> <option>date of birth month</option> <option value="06">06</option>
year
<select id="dobyear" name = "dobyear" class="pure-input-1-4"> <option>date of birth year</option> <option value="2000">2000</option>
after form has been posted ,it gets collects :
$dobday = $_post['dobday']; $dobmonth = $_post['dobmonth']; $dobyear = $_post['dobyear'];
how dateformat stored mysql date feild. have searched web , cannot find example anywhere assistance.
try :
$dobday = '21'; $dobmonth = '09'; $dobyear = '1986'; $full_date = $dobyear.'-'.$dobday.'-'.$dobmonth; echo $full_date;`
Comments
Post a Comment