Re: [phplib] Call $sess->register from a function From: R.B. Scholtus (regiment <email protected>)
Date: 10/16/00

why don't you global the variable in the function? this should work:

page_open (...);

....

function be_usefull_please() {
    global $sess, $usefullness;
    ...
    $sess->register("usefullness");
    ...
}

....

----- Original Message -----
From: Adam Weisbart <adam <email protected>>
To: <phplib <email protected>>
Sent: Sunday, October 15, 2000 10:00 PM
Subject: [phplib] Call $sess->register from a function

> Greetings,
>
> I am trying to call:
>
> $sess->register("variable");
>
> ...from inside a function and it does not work. If I move the code out of
> the function and into the main body of the script, it works fine. I
realize
> this is a scope problem, but I have been unable to remedy it. Any ideas? I
> am able to register the variable in main, and then pass it by reference to
> the function, but this seems rather messy.
>
> Thank you!
>
> -Adam
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: phplib-unsubscribe <email protected>
> For additional commands, e-mail: phplib-help <email protected>

---------------------------------------------------------------------
To unsubscribe, e-mail: phplib-unsubscribe <email protected>
For additional commands, e-mail: phplib-help <email protected>