combining variables
| From: | Tyler Longren | Date: | Wed, 12 Sep 2001 20:52:19 +0000 |
| Subject: | combining variables | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-67081@lists.php.net to get a copy of this message | ||
Hello,
I have this:
for ($i=1; $i<=$num_answers; $i++) {
print "<b>Answer $i:</b> <input type=text
name='answer$i'><br>";
}
The user will enter the possible answers up there. When that form is
submitted, I want to take the value from answer$i ($answer$i). I can't do
this though. Here's what I've done:
for ($i=1; $i<=$num_answers; $i++) {
$insert_data_sql .= "'$answer$i', ";
}
Everytime I do a print "$answer$i", 1 is printed, or 2 is printed, or
3....and so on. So the actual value of that form field isn't printed. Is
there any way to get around this?
Thanks,
Tyler Longren