rendered paste body$no_of_q=3;
$no_of_a=2;
$question_index=1;
echo "
<br>Add a course:
<form method=POST action=addquiz.php>
Quiz Name: <input type='text' name='question[0][0][0]'><br><br>";
while ($question_index <= $no_of_q)
{
echo "Question " . $question_index . ": <input type='text' name='question[$question_index][0][0]'><br><br>";
$answer_index=1;
while ($answer_index <= $no_of_a)
{
echo "Answer " . $answer_index . ": <input type='text' name='question[$question_index][$answer_index][0]'>";
echo "<input type='checkbox' value='" . $question[$question_index][$answer_index][0] . "' name='question[$question_index][$answer_index][1]'><br><br>";
$answer_index++;
}
$question_index++;
}
echo "<input type=submit name=submit value='Add'>";
echo "</form>";