Jacky schrieb:
> <!-- 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";
> }
What's the value of $id in the second snippet? Generally speaking using
$GLOBALS[$id] gives you more readable code but variable variables.
Ulf
--
Neu: PEAR Menu 3 - Navigationsstrukturen dynamisch dargestellt
http://www.ulf-wendel.de/projekte/menu/tutorial.php |
http://www.phpdoc.de
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]