I am stuck.
I need a function to use to return the value of a list of variables:
function myFunk ($a, $b, $c) {
echo $a $b $c;
}
Let's say these are the values, but they are unknown to me:
$a=1; $b=2; $c=3;
Moreover, the variables themselves are unknown. All I know is the name of the list that holds the variable names:
$vars='$a, $b, $c';
I need a function to use the list to return the value of the variables:
function myFunk ($vars) {
echo values;
}
The reason I need this is to handle the CGI for a form that reads a mysql database. The form reads the table's field names and creates the form fields dynamically from this. But to handle an update request I have to dynamically retrieve the variable names and values coming from the CGI at runtime.
So, as in the above case, the CGI sends:
mydoc.php?a=1&b=2&c=3
At runtime I go to the table to get a list of field names and add a "$" to them, and this becomes the list of variable names the CGI is passing:
$vars='$a, $b, $c';
I can't get a function to understand that the variable list should be interpreted as variables that hold the CGI data.
Looking for help,
Robyn