Atanu Posted December 7, 2006 Share Posted December 7, 2006 Hi friends,I have problem again.I have created a registration form in PHP using HTML only.There are three drop down menus containing DAY,MONTH and YEAR.when I select the year 2000 for a month February then it displays 31 days.But I want that it will display the exact days of each month.like january containg 31 day,April contains 30 days.In the year of 2000,February-(contains)29 days,where 2001-February-(containing)28 days.Have u understood what I want to say.Plz do reply soon.Thanx for reading. Quote Link to comment Share on other sites More sharing options...
taith Posted December 7, 2006 Share Posted December 7, 2006 if you put month, year in there, it'll tell you how many days are in that month.[code]<?function get_daysinmonth($month, $year){ if(checkdate($month, 31, $year)) return 31; elseif(checkdate($month, 30, $year)) return 30; elseif(checkdate($month, 29, $year)) return 29; elseif(checkdate($month, 28, $year)) return 28; return FALSE;}?>[/code] Quote Link to comment Share on other sites More sharing options...
Atanu Posted December 7, 2006 Author Share Posted December 7, 2006 I have mentioned that I have created a registration form where the user will input their Date of birth.and the DOB may be what ever.You r using the correct process but It's not so easy to complete the work.It will be very time consuming.is there any easy way to solve that? Quote Link to comment Share on other sites More sharing options...
trq Posted December 7, 2006 Share Posted December 7, 2006 Really, this problem would be better dealt with using Javascript. Quote Link to comment Share on other sites More sharing options...
taith Posted December 7, 2006 Share Posted December 7, 2006 if your looking to make them changes without reloading the page, your gunna want to look for javascript, or ajax, else, you just need a little creativity. Quote Link to comment Share on other sites More sharing options...
Atanu Posted December 7, 2006 Author Share Posted December 7, 2006 i have a little concept on javascript.so can u help me for doing it using java script. Quote Link to comment Share on other sites More sharing options...
fenway Posted December 16, 2006 Share Posted December 16, 2006 Just use a proper date picker, and all of this goes away. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.