如何获取出生日期值到数据库 [英] how get Date of birth value to database

查看:65
本文介绍了如何获取出生日期值到数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何通过我的注册页面将这个生日函数值发布到我的数据库中?请帮忙 !!任何其他建议,我都需要在我的php表单中添加三项.

how i can post this date of birth function value to my database through my registration page? Please help !! Any other suggestions, i need three drop down in my php form.

<?

function date_dropdown($year_limit = 0){

        $html_output = '    <div id="date_select" >'."\n";

        $html_output .= '        <label for="date_day"></label>'."\n";



        /*days*/

        $html_output .= '           <select name="date_day" id="day_select">'."\n";

            for ($day = 1; $day <= 31; $day++) {

                $html_output .= '               <option>' . $day . '</option>'."\n";
            }
        $html_output .= '           </select>'."\n";

        /*months*/
        $html_output .= '           <select name="date_month" id="month_select" >'."\n";
        $months = array("", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
            for ($month = 1; $month <= 12; $month++) {

                $html_output .= '               <option value="' . $month . '">' . $months[$month] . '</option>'."\n";
            }
        $html_output .= '           </select>'."\n";

        /*years*/
        $html_output .= '           <select name="date_year" id="year_select">'."\n";
            for ($year = 1900; $year <= (date("Y") - $year_limit); $year++) {

                $html_output .= '               <option>' . $year . '</option>'."\n";
            }
        $html_output .= '           </select>'."\n";

        $html_output .= '   </div>'."\n";
    return $html_output;
}


?>


html form code:
 <td>			// or add date of birth age condition in ()
							 echo date_dropdown();
							 		?>
			</td>

推荐答案

year_limit = 0){ span>
year_limit = 0){


html_output > < div id =" date_select>' ."\ n"; span>
html_output = ' <div id="date_select" >'."\n";


html_output > =' ."\ n"; span> /*天数*/ span>
html_output .= ' <label for="date_day"></label>'."\n"; /*days*/


这篇关于如何获取出生日期值到数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆