I have a script which creates a web page which displays details of members of staff.
I am looking at allowing the users to change the details on this screen.
Most of the details only have 1 value eg. Surname, but there are a couple that have more than 1 value eg. Deparment STP,
Technical Support
32.
and is stored in field ou[0],ou[1] and ou[3] respectfully. The screen only holds the [0] field.
I have overcome the problem of capturing the subsequent values by running a function
(define_oddeleni) which will add the other values to the ou field. The values of the ou array are correct ie. all 3 values appear when I do an echo.
This function is called from within another function (zmenit_data) but only the [0] value is known.
How do I transfer the values of the array from define_oddeleni to zmenit_data.
Here is a snippet of my code:-
function zmenit_data()
{
global $HTTP_GET_VARS;
global $input;
while (list($key, $value) = each (HTTP_GET_VARS))
{
$input = array (
"$key" => array ("0" => "$key: $value",
);
if (($key) == "ou")
define_oddeleni(&$value);
echo "array = ".$input[$key][1]."<br>";
etc.
}
function define_oddeleni(&$value)
{
global $HTTP_GET_VARS;
global $input;
if (($value) == "STP")
{
$input = array (
"$key" => array (
"0" => "$key: $value",
"1" => "$key": Technical Support",
"2" =>"$key: 32"
),
);
}
}
There are 15 keys for each record.
LDAP requires this information as an array in order to modify its database.
I hope you can help
Thanks in advance
Tony