ENV Variables.

Chuck Hagenbuch chuck@horde.org
Tue, 17 Oct 2000 10:20:07 -0400 (EDT)


Quoting James Parker <james@fast.net.uk>:

> Thanks for your earlier reply, and sorry to mail you off list - but I need a
> bit of clarification re: the ENV variables thing.  I'm writing a script in
> perl that looks like this (called from prefs.php3) :

First, if it might be useful to other people, please keep it on list.

> <extraneous stuff snipped>
> 
> $user = $imp->user;
> print $user;
> 
> and it returns nothing.
> 
> Do I need to import these somehow ?  Sorry about this, I've had it dumped on
> me from above.

Okay... IMP's variables (user, etc.) are not anywhere in the webservers's 
environment. One thing you might look at is Atif Ghaffar's perl libraries that 
read Horde sessions; also, how are you "calling" your perl script from 
prefs.php3? You could just pass the username along (depending on how you're 
calling things), if that's all you need.

> ps - if I swap $imp->user for $imp['user'] that returns nothing as well.

Well, what version of IMP are you using? I told you what syntax to use for 
which version...

-chuck

--
Charles Hagenbuch, <chuck@horde.org>
Many states consider gambling so immoral that they not only prohibit private
gambling organizations, they thoughtfully provide their own.