Sorry, it works just making $auth global. Sorry, until now I haven't
realized that I was calling the function before calling open_page, so
the $auth variable was not created yet.
;)
Eduardo Alfonso
On Fri, 18 Mar 2005 20:12:54 -0500, Eduardo Andr=E9s Alfonso Sierra
<ed...@gm...> wrote:
> Hi, It's me again here learning phplib.
>=20
> Now, my problem is this way.
>=20
> From a normal script, I mean, from a php page accessed by a user I
> call a function that I developed.
>=20
> I need in that function access the authentication and session
> infromation. For example, I want in that function to know the
> authenticated user name to send an e-mail or something.
>=20
> Is any posibility to "propagate" these variables ($sess, $auth for exampl=
e) ??
>=20
> I tried many ways, declaring it globals and several more and never got th=
e goal.
>=20
> The only way I've been able to do that is passing these data as
> parameter to the function. I really don't like that solution, I think
> there must be some, "more natural" way to do that, I think it's just
> to tell the function to use the "environment" or request information
> of the calling page but have no idea on doing that.
>=20
> Any ideas ??
>=20
> Thanks again, and again
>=20
> Eduardo Alfonso
>
|