how to get the name of a variable?
| From: | Juan Luis Baptiste | Date: | Tue, 15 Feb 2000 04:18:54 +0000 |
| Subject: | how to get the name of a variable? | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-10282@lists.php.net to get a copy of this message | ||
Hi, I got varius radio buttons on a form like this:
<input type="radio" name="1" value="pos">
<input type="radio" name="1" value="neg">
<input type="radio" name="2" value="pos">
<input type="radio" name="2" value="neg">
<input type="radio" name="3" value="pos">
<input type="radio" name="3" value="neg">
.......
They are a lot of them so I want to do something like a loop for getting the radio buttons values
into a database.
Is there a way of get the names of the variables?
For example, I got this reult from the form:
$1="pos";
$2="neg";
$3="pos";
.... and so on...
the table have three columns--> id,exam_number, value. The values of the radio buttons have to
be on the table like this:
ID | exam_number | value
----------------------------------------
101 | 1 | pos
102 | 2 | neg
103 | 3 | pos
......
'ID' is an auto increment value, 'exam_number' is the name of the radio button
variable and 'value' is the value of the radio button selected.
Any ideas?
Thanks,