Welcome to Discuss Everything Forums...

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed.


 

Reply to Thread

Post a reply to the thread: How can I make a form using HTML and PHP for a birthday?

Your Message

Click here to log in

What is the sum of 36 and 12

 
 

You may choose an icon for your message from this list

Additional Options

  • Will turn www.example.com into [URL]http://www.example.com[/URL].

Rate Thread

You may rate this thread from 1-star (Terrible) to 5-stars (Excellent) if you wish to do so.

Topic Review (Newest First)

  • 11-01-2012, 04:00 PM
    Sako

    How can I make a form using HTML and PHP for a birthday?

    I want to make a form with 3 select boxes, one for month, one for day, and one for year. I want to hold the values in an array and use the array values to put them into select boxes. I successfully made the month array and select box but the problem is selecting how many days in the month. How can I make it so that the days are able to be shown in the array according to what month it is? ex: January, March, May have 31 days and February has 29/30, April has 30 and depending on which month is chosen the corresponding day is available for selection.

    This is my PHP code for months:
    $month = array ("", "Jan", "Feb", "Mar", "Apr", "May",
    "Jun", "Jul", "Aug", "Sep", "Oct",
    "Nov", "Dec");


    echo '<select name="dobmonth>';

    foreach ($month as $dobmonth)
    {
    echo '<option value="'.$dobmonth.'">'.$dobmonth.'</option>';
    }
    echo '</select>';

    Thanks for any help.

Posting Permissions

  • You may post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts
  •