Re: Two technical questions
| From: | Chris Moyer | Date: | Fri, 02 Jun 2000 02:56:43 +0000 |
| Subject: | Re: Two technical questions | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-883@lists.php.net to get a copy of this message | ||
On Thu, Jun 01, 2000 at 06:17:20PM -0400, Jerome Loisel wrote:
>
> Is it possible to execute a program from withing PHP and interact with it via
> stdin/stdout? I have an external program which handles some security aspects
> and need to feed it username/password via its stdin.
Hmm, popen will allow you to open a process and either write to stdin,
or read from stdin. You could do a hack like this:
$tempfile = tempnam("./tmp/","temp");
$fp = fopen($tempfile,"w");
fputs($fp,"This is cool\n");
fputs($fp,"This is a test\n");
fputs($fp,"This is not a test\n");
fclose($fp);
$fp = popen("/bin/grep test < ".$tempfile,"r");
fpassthru($fp);
unlink($tempfile);
> Second question:
> In what way does IE differ from Netscape with regards to how cookies and
> authentication headers interoperate? I have the following code, which only
> works under Netscape. In IE, the authentication headers are passed properly,
> but the cookies are not set.
What kind of problems are you getting with IE? Everything looks Ok.
-- Chris Moyer -- cmoyer@chekinc.com --
PHP Developer -- Chek.com