to give you an idea what I've been trying, the following seems to work logically but times out at the while loop:
// array of checked boxes in the form
$checked_days = array($recur_weeks_sun,$recur_weeks_mon,$recur_weeks_tue,
$recur_weeks_wed,$recur_weeks_thu,$recur_weeks_fri,$recur_weeks_sat);
foreach ($checked_days as $day) {
if ($day) {
$each_days = array(1=>Mon,2=>Tue,3=>Wed,4=>Thu,5=>Fri,6=>Sat,0=>Sun);
$get_day_num = array_search ("$day", $each_days);
$bg_day = date("w", mktime(0,0,0,$start_month,$start_day,$start_year));
$start_date_loop = $datebox3;
while ($bg_day != $get_day_num) {
$bg_day = date("w", mktime(0,0,0,$start_month,$start_day+1,$start_year));
$start_date_loop = date("m/d/Y", mktime(0,0,0,$start_month,$start_day+1,$start_year));
}
echo "$start_date_loop";
}
}
In my head the logic is: loop through the checkbox array. If the day is checked, create an array of the days and their day numbers according to date. Do a search of the new array with the day (result $get_day_num). Get the beginning day number (bg_day). If bg_day isn't equal to $get_day_num, increment the daynumber and the start_date until the correct day number is reached. That correct day number should be the correct start date for the event.
Does that make any sense?
Thanks