Hi All!

  Here's something I am trying to do, and I don't know if it's possible. I
have a function that must register session variables, values that come from
an array. But each of these values will be the value of an session array, of
non-fixed size.

  Let me explain (w and d stands for Write and Del):

What I need:
$_SESSION['news']['w'] = 1;
$_SESSION['news']['d'] = 1;

  So what I am doing:

$w = 1;
$d = 1
$powers = ($w, $d); // This array can have an undetermined number of values

function MakePowers ($area, $powers)
    foreach ($powers as $value) {
        $area = $value;

  Now here comes the real problem, $area specifies where in the $_SESSION
array I will store the power.

  I did $area = $_SESSION['news'] but gives me a "undefined index 'news". I
could define 'news' for each page of my application but that's not much
function reuse :-)

  And $area could be, in different pages, $_SESSION['news]['admin'],
$_SESSION['forum'], etc...

  That's my non-fixed sized array. I need to make a central function that
will store in different keys of $_SESSION values that say what powers the
user has, powers that come from the $powers array.

  ANY help? I hope I did a good job trying to explain what I am trying to do

  Many thanks for any help, sincerely!


Julio Nobrega.

PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to