I was recently given the task of fixing a PHP application page. I don't know PHP, but I do have extensive knowledge of java, js and c/c#/c++.
That being said, I'm at a loss to fix my problem. The PHP page is a registration form with names, birthdays, etc, all your standard stuff.
When you fill out the birthday and submit it, the birth day is almost always 1 - sometimes it's 2(very infrequently) and sometimes it will roll back to 31(no provision in code for different lengths of the months).
I've attached the code for the birth day drop down. I attempted to add the debug lines and neither of them worked for me. The birth month and birth year code all works as it should, only problem being with the day.
Any insight offered would be greatly appreciated.
Expand|Select|Wrap|Line Numbers
- echo "<select size='1' name='child_dob_day[".$child."]'>";
- for ($day=1;$day<=31;$day++)
- {
- echo "<option value='".$day."'";
- if ($form->values["child_dob_day"][$child] == $day)
- echo " selected";
- echo ">".$day."</option>";
- }
- echo "</select>";