Variable variable
| From: | Jacky | Date: | Wed, 18 Apr 2001 19:00:56 +0000 |
| Subject: | Variable variable | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-49138@lists.php.net to get a copy of this message | ||
Hi all
I have a form with check box and name of those checkboxes is usuing variable lke this,
<!-- I got the value $id from a table and looping them and assign them to the check box
name-->
<input type="checkbox" name ="$id" value="on">
and when I submit the form to page foo.php4, at that page, I use Variable variable to call the value
of the check box to see if it checked like this
$quey = "select id from table";
$result = ...... ( assumeing it is done and i got value for $id for all records from table)
if ($$id =="on"){
echo "on";
}else{
echo "off";
}
It always returns echo "off", why is that?
cheers
Jack
jacky@activelifestyle.com
"There is nothing more rewarding than reaching the goal you set for yourself"