I have a form with a lot of textareas.
<textarea cols="30" rows="6" id="q1"></textarea>
<textarea cols="30" rows="6" id="q2"></textarea>
<textarea cols="30" rows="6" id="q3"></textarea>
...
<textarea cols="30" rows="6" id="q54"></textarea>
Don't ask why we need 54 questions.
I want to print them out but don't want to do it manually.
$i = 1;
while ($i <= $countTextareas) {
$questID = "q" . $i;
$question = $_POST[$questID];
echo "Question " . $i . ": " . $question . "<br />";
$i++;
}
The result of that code is:
Question 1: <br />
Any assistance or even a point in the general direction would be great.
Thanks in advance.
It may not be the most elegant solution but it works...
$i = 1;
while ($i <= $countTextareas) {
$question = $_POST['question'][$i];
echo "Question " . $i . ": " . $question . "<br />";
$i++;
}