I am including file, with part of code that performs authorization, in the beginning of files that need authorization.
Module with authorization:
<?
if(!isset($PHP_AUTH_USER)) {
Header("WWW-Authenticate: Basic realm=\"..\"");
Header("HTTP/1.0 401 Unauthorized");
exit;
} else {
checking login and pass...
if ($auth=="ok") {
?>
And file where it included
<?php
include("auth.php3");
code...
code...
code...
}
} else {
Header("WWW-Authenticate: Basic realm=\"..\"");
Header("HTTP/1.0 401 Unauthorized");
exit;
}
?>
Everything worked well with php3. When I installed php4 at once appeared troubles.
Seems that php4 doesn't parse included code.
Why can it be?