Hi
I use a system where people can via a form select functions to be run via boxes they check (in my case the functions create statistics). Then $REQUEST['selections'] wich contains a NAME is looped in a foreach. This NAME is then used to figure out the function and get associated vars to pass to it by getting $REQUEST[NAME . 'func'] wich contains name of function and $REQUEST[NAME . '_vars] wich is an array of values passed by hidden fields and other input.
Now, one way to enter input into a function would be to use a list with multiple selections allowed. Here is were I run into trouble. I thought that the vaules of that list would be stored in $REQUEST[NAME . 'vars] as an array in itself (since all var fields including that list is named the same). It workes frine for hidden fields and inputboxes, but not for my multiple list.
Heres an idea so you understand the flow.
The part were it checks all the vars for @ is just beacuse I use that to tell that the vakue shoulkd be fetched from another textbox or similar.
foreach($_REQUEST['selections'] as $selection)
{
foreach($_REQUEST[$selection.'_vars'] as $var)
{
if(strstr($var, "@"))
{
$vars[] = $_REQUEST[str_replace("@", "", $var)];
}
else
{
$vars[] = $var;
}
}
$statdata[$selection]['text'] = $_REQUEST[$selection . '_text'];
$statdata[$selection]['data'] = createDataInInterval($name = $_REQUEST[$selection . '_name'], $start_date, $end_date, $interval, $_REQUEST[$selection . '_func'], $vars);
unset($vars);
}
Any ideas on how I should grab the values of my listbox?