Two technical questions
| From: | Jerome Loisel | Date: | Thu, 01 Jun 2000 22:17:20 +0000 |
| Subject: | Two technical questions | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-876@lists.php.net to get a copy of this message | ||
Hi folks, thanks for reading.
First question:
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.
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.
BEGIN CODE
/* Set a cookie to keep track of the default look. */
setcookie("KOS_DefaultLook", "$look", time() + 360000, "/");
/* Determine whether or not to authenticate. */
if ($Current_Section == "admin/") {
$KOS_Authenticate = "yes";
$KOS_Logout = "no";
if ($KOS_Small_Filename == "logout") {
$KOS_Authenticate = "no";
$KOS_Logout = "yes";
}
}
else {
if ($HTTP_COOKIE_VARS["KOS_Authenticate"] == "yes" && $KOS_Logout !=
"yes") {
$KOS_Authenticate = "yes";
}
}
/* Set authentication cookies if necessary. */
if ($KOS_Logout == "yes") {
unset($KOS_UserName);
$KOS_Authorized = 0;
$KOS_Authenticate = "no";
setcookie("KOS_Authenticate", "no", time() + 360000, "/");
}
else {
if ($KOS_Authenticate == "yes") {
setcookie("KOS_Authenticate", "yes", time() + 3600, "/");
}
}
/* Authenticate if necessary. */
if ($KOS_Authenticate == "yes" && $KOS_Logout != "yes") {
if (!isset($PHP_AUTH_USER)) {
[access denied]
}
}
[check username and password]
END OF CODE
Anyone know why?
Thanks very much in advance to everyone. Cheers,
Jérôme Loisel