Re: [PHP] passthru environment variables
OK, I finally found it. Someone else here recommended setenv -- it's actually putenv. putenv was *not* found through any search I could make on the PHP Web site involving the word environment and so on, I found it through Google. And it's apparently documented under "PHP Options and Information" where I wouldn't have thought to look for it for a thousand years. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] passthru environment variables
Tim Ward <[EMAIL PROTECTED]> wrote: > fpassthru doesn't include the code in your php code. In just dumps the file > to output as it runs. I was using the command "passthru", which is supposed to pass the *output* of an external program through to standard out. In other words, let's say I wanted people to be able to see how long my system was up, I could have a PHP program display other information and then call the Linux command "uptime" and pass the result to the user's browser. For the application that I'm working on, I need to use "passthru" (or possibly "system") rather than having a line or two of output passed back to the PHP program because the external program I'm using will produce up to hundreds of pages of output. >Anything defined in PHP (inluding variables and > functions) in the file passed through will not be available to the calling > program. I want the variables in the PHP program to be available to the external program through the shell environment of the forked external program. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
RE: [PHP] passthru environment variables
fpassthru doesn't include the code in your php code. In just dumps the file to output as it runs. Anything defined in PHP (inluding variables and functions) in the file passed through will not be available to the calling program. You need include(); Tim Ward Senior Systems Engineer Please refer to the following disclaimer in respect of this message: http://www.stivesdirect.com/e-mail-disclaimer.html > -Original Message- > From: Rich Puchalsky [mailto:[EMAIL PROTECTED]] > Sent: 11 February 2001 05:52 > To: [EMAIL PROTECTED] > Subject: [PHP] passthru environment variables > > > I'm trying to use passthru in a PHP program to have an > external program > display some data. The problem is that I was trying to have > the external > program's environment pick up the form field variables > automatically passed > into the PHP program as shell environment variables. > > In other words, if a user typed "Smith" into the last_name > field in a form, > the PHP program called by that form starts out with > $last_name = "Smith", > and I would like the external program called by passthru > within the PHP > program to have a shell environment variable last_name = "Smith". > > Does anyone know an easy way to do this? > > > > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] passthru environment variables
"Rich Puchalsky" <[EMAIL PROTECTED]> wrote in message 966dad$pkm$[EMAIL PROTECTED]">news:966dad$pkm$[EMAIL PROTECTED]... > "Richard Lynch" <[EMAIL PROTECTED]> wrote: > > http://php.net/setenv > > Thanks! But when I try this link, or the "Quick Ref" button on the PHP home > page, I can't find anything about setenv. And the manual doesn't have > anything about it under Program Execution Functions. Is it undocumented? And once I actaully tried it, I got an undefined function message. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] passthru environment variables
"Richard Lynch" <[EMAIL PROTECTED]> wrote: > http://php.net/setenv Thanks! But when I try this link, or the "Quick Ref" button on the PHP home page, I can't find anything about setenv. And the manual doesn't have anything about it under Program Execution Functions. Is it undocumented? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]
Re: [PHP] passthru environment variables
> I'm trying to use passthru in a PHP program to have an external program > display some data. The problem is that I was trying to have the external > program's environment pick up the form field variables automatically passed > into the PHP program as shell environment variables. > > In other words, if a user typed "Smith" into the last_name field in a form, > the PHP program called by that form starts out with $last_name = "Smith", > and I would like the external program called by passthru within the PHP > program to have a shell environment variable last_name = "Smith". > > Does anyone know an easy way to do this? http://php.net/setenv Since you probably want to do this for all your POST vars, check out http://php.net/FAQ.php#7.1 -- Visit the Zend Store at http://www.zend.com/store/ Wanna help me out? Like Music? Buy a CD: http://l-i-e.com/artists.htm Volunteer a little time: http://chatmusic.com/volunteer.htm -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]