#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    10
    Rep Power
    0
    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"
    ),

    );
    }
    }

    LDAP requires this information as an array in order to modify its database.

    I hope you can help

    Thanks in advance

    Tony
  2. #2
  3. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2000
    Posts
    10
    Rep Power
    0
    Sorry I have ommitted a ) after the following line in funcion zmenit_data

    "$key" => array ("0" => $key: $value"),

Similar Threads

  1. Javascript: trying to pass variable directly to array
    By Sunny Monkey in forum JavaScript Development
    Replies: 12
    Last Post: December 6th, 2004, 10:17 AM
  2. Uploading Files
    By vivekjain in forum ASP Programming
    Replies: 0
    Last Post: February 17th, 2004, 12:21 AM
  3. 2d array passed to a function
    By capaci in forum C Programming
    Replies: 1
    Last Post: February 13th, 2004, 10:54 PM
  4. array cannot be used as a function error:
    By helz in forum C Programming
    Replies: 7
    Last Post: January 20th, 2004, 12:21 PM
  5. Passing array to function return problem
    By TuxLives in forum PHP Development
    Replies: 2
    Last Post: January 15th, 2004, 10:49 AM

IMN logo majestic logo threadwatch logo seochat tools logo