Jump to content

drop down menu problem


Atanu

Recommended Posts

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.
Link to comment
https://forums.phpfreaks.com/topic/29793-drop-down-menu-problem/
Share on other sites

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]
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?
  • 2 weeks later...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.