Php/mysql help needed

I want users to add the amount of events they need to be added,
Then send all of the events to the db when they click ‘Add Event’ button;

Therefore if the user added 3 events fields to be displayed, the 3 sets of info is recorded.

I am printing the input to see if the code is correct before I them to add to the db

Take a look to see what I am talking about, add 2 or 3 # of events and click ‘Add Event’
then analyze at the output.
url: http://www.exit8asamplesales.com/test.php
here is the code:


<?php
$month = array('January','Febuary','March','April','May','June','July','August','September','October','November','December');
$dayArray = array('AM','PM');
$year = date('Y');
$day = $_POST['day'];
$startTime = $_POST['startTime'];
$endTime = $_POST['endTime'];
$months = $_POST['months'];
$Adaytime = $_POST['Adaytime'];
$Pdaytime = $_POST['Pdaytime'];
$message = '';
$events_no = $_POST['events_no'];
 
$event_no = 1; 
if ( isset($_POST['Add']) )
{
 if  ($event_no > 0)
 { 
 $event_no = $events_no; 
 }
 
 ##---IF EVENT NUMBER IS LESS THAN OR = TO 0
 if ( ($event_no == 0)|| ($event_no < 0) )
 {
  echo '<script>alert("Number of Events should be greater that 0");</script>';
  $event_no = 1; 
 }
}
if ( isset($_POST['addevents']) && ($_POST['addevents'] == 'Add Event') )
{
 
 for ($k=1;$k<=$events_no;$k++)
 {
 echo 'Month: '.$months.'<br />';
 echo 'Day: '.$day.'<br />';
 echo 'Year '.$year.'<br />';
 echo 'Start Time: '. $startTime.'<br />';
 echo 'AM: '.$Adaytime.'<br />';
 echo 'End Time: '.$endTime.'<br />';
 echo 'PM: '.$Pdaytime.'<br /><br />';
 }
 //add events to db here 
    } 
 
 
 $msg = 'Events Added Sucessfully.';
 print '<div align="center"><font color="red">'. $msg .'</font></div>';
##---ADDRESS FORM FIELDS.
 
?>
<form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="post">
<table width="" border="0" cellpadding="2" cellspacing="1" align="center" >
  <tr><td colspan="6"> 
    <b>Events</b>
 <hr color="#47928B" noshade="noshade" size="3" width="100%" align="left" />
  </td></tr>
  <tr><td><input type="text" name="events_no" size="5" value="<?php echo $event_no ?>" /></td>
  <td colspan="6"><input type="submit" value="Number of Events to Add" name="Add" /></td></tr>
<?php
##---FOR LOOP TO DISPLAY THE AMOUNT OF EVENT TO ADD
for ($events=1;$events<=$event_no;$events++)
{
?>
  <tr>
    <td>Event <?php echo $events; ?></td>
    <td>
 <select name="months" id="months<?php echo $events; ?>" value="<?php echo $monthArray; ?>" >
 <?php
 ##---ARRAY TO DISPLAY MONTH
 foreach($month as $monthArray){
 ?>
 <option value="<?php echo $monthArray; ?>"><?php echo $monthArray; }?></option></select></td>
    <td>
 <select name="day">
<?php 
for ($i=1;$i<32;$i++)
{
?>
 <option value="<?php echo $i; ?>"><?php echo $i; }?></option></select>
 </td>
    <td><select name="year">
  <?php
  for ($year1=$year;$year1<$year+5;$year1++)
  { 
  ?>
 <option value="<?php echo $year1; ?>"><?php echo $year1; }?>
 </option></select></td>
    <td>Start Time: </td>
    <td><input type="text" size="5" name="startTime" value="<?php echo $startTime; ?>" /></td>
    <td><select name="Adaytime" value="<?php echo $TimeOfDay; ?>">
 <?php
 ##---ARRAY TO DISPLAY TIME OF DAY
 foreach($dayArray as $timeOfDay){
 ?>
 <option value="<?php echo $timeOfDay; ?>"><?php echo $timeOfDay; }?>
 
 </option></select></td>
 <td>End Time: <input type="text" size="5" name="endTime" value="<?php echo $endTime; ?>" /></td>
    <td><select name="Pdaytime" value="<?php echo $TimeOfDay; ?>">
 <?php
 ##---ARRAY TO DISPLAY TIME OF DAY
 foreach($dayArray as $timeOfDay){
 ?>
 <option value="<?php echo $timeOfDay; ?>"><?php echo $timeOfDay; }?>
 
 </option></select></td>
  </tr>
<?php 
} 
?>
<tr><td><input type="submit" value="Add Event" name="addevents" /></td></tr>
</table>
</form>