help me to validate calendar function

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
raj86
Forum Commoner
Posts: 25
Joined: Tue Sep 29, 2009 12:28 am

help me to validate calendar function

Post by raj86 »

hello friends
i am having calendar function ....but i dont know how to validate it and how to send its value to data base.....please help me in this
i tried it but not getting

Code: Select all

//This function makes 3 pulldown menus for the months, days, and years.
         function make_calendar_pulldowns2($m2 = NULL, $d2 = NULL, $y2 = NULL)
         {
         //Make the years pull-down menu.
            echo '<select name="year2">';
            for ($year2 = 1960; $year2 <= 2022;
            $year2++)
               {
               echo "<option value=\"$year2\"";
               if ($year2 == $y2)
                  {
                  //Preselect.
                  echo ' selected="selected"';
                  }
               echo ">$year2</option>\n";
               }
            echo '</select>';
            
         //Make the months array.
         $months2 = array (1 => '1','2','3','4','5','6','7','8','9','10','11','12');
            
            //Make the months into a pulldowm.
            echo '<select name="month2">';
            foreach ($months2 as $key => $value)
               {
               echo "<option value=\"$key\"";
               if ($key == $m2);
                  {
                  //Preselect.
                  echo ' selected="selected"';
                  }
               echo ">$value</option>\n";   
               }
            echo '</select>';
            
            //Make the days pull-down menu.
            echo '<select name="day2">';
            for ($day2 = 1; $day2 <= 31; $day2++)
               {
               echo "<option value=\"$day2\"";
               if ($day2 == $d2)
                  {
                  //Preselect.
                  echo ' selected="selected"';
                  }
               echo ">$day2</option>\n";
               }
            echo '</select>';
         }//End of Function Definition
         
     
         //Get today's date and call the function.
 
         $dates2 = getdate();
         $date_birth = "make_calendar_pulldowns2";
         $date_join = "make_calendar_pulldowns2";
         $date_term = "make_calendar_pulldowns2";
Post Reply