PDA

View Full Version : putenv() in header template doesn't work


Eunos
Fri 5th Jan '01, 8:12pm
Maybe I'm doing this wrong. I currently have an SSI program that I use in non-php mode that is executed by first setting an environment variable using code like this:

<!--#set var="RANDSELECT_CONFIG" value="mydir/file.txt" -->
<!--#include virtual="/cgi-bin/randselect" -->

Porting to PHP, I theoretically should be able to get the same functionality as follows:

putenv ("RANDSELECT_CONFIG=mydir/file.txt");
virtual ("/cgi-bin/randselect");

But when I put this in "header", it doesn't work. The environment variable never gets set. At least not in the same shell that the randselect program runs.

Thoughts??