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
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]
Link to comment
Share on other sites

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?
Link to comment
Share on other sites

  • 2 weeks later...
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.