Re: Parse errors with includes and/or prepends/appends
| From: | Seth Hollyman | Date: | Tue, 13 Jun 2000 22:05:45 +0000 |
| Subject: | Re: Parse errors with includes and/or prepends/appends | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-1769@lists.php.net to get a copy of this message | ||
On Tue, 13 Jun 2000, Matthew Leverton wrote:
> I believe that both require() and include() need to have completed scripts
> within them. What I do in your situation is this:
>
> <?
> session_register($auth_flag);
>
> if ($auth_flag != 1) {
> header("Location: ./login.php4");
> }
> ?>
Thanks for the suggestion. However, there's still a problem with this
method. While it does provide a method for the browser to redirect
someone to the login page, it also still sends the contents of the
document that they haven't authenticated to see. The Location: header
relies on the browser to do redirection; it also sends the output of the
page. Checking by requesting the page via netcat confirmed this.
Is there a function or method that tells PHP to stop
parsing/outputting? If so, this method can still be used. Otherwise, its
not secure enough for my needs.
Seth