hi...All
I need to add a user registration form to my web site and have intended to obtain user's date of birth through the form. I used 3 combo boxes to select to users their date of birth. so i need to validate these values before submitting and need to insert these values to the database.
-------------------------------------------------------------------
MY HTML CODE
<form action="" method="post">
<label>Date of Birth : </label>
<?php
// month array
$month = array( 1 => 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August');
echo '<select name="' . $month . '">';
foreach ( $month as $k => $v ) {
echo '<option name="'. $v . '" value="' . $k . '">' . $v . '</option><br />';
}
echo '</select> <select name="day">';
for ( $i = 1; $i <= 31; $i++) {
echo '<option name="'. $i . '" value="' . $i . '">' . $i . '</option><br />';
}
echo '</select> <select name="year">';
for ( $i = 1950; $i <= 2050; $i++) {
echo '<option name="'. $i . '" value="' . $i . '">' . $i . '</option><br />';
}
echo '</select>';
?>
<br /><br />
<input type="submit" value="Submit" name="submit" />
<input type="hidden" value="TRUE" name="submitted" /></form>
My database name is : mydb
My table is : users
Table column is : dob DATE
I need php coding for validation and insert into database.
------------------------------------------------------------------
Thanks again and look forward to hearing from you soon.
Tharanga Nuwan