Re: HOW TO GO TO WEB PAGE AFTER AUTHENTICATION?
| From: | Chris Newman | Date: | Sat, 24 Jun 2000 16:15:37 +0000 |
| Subject: | Re: HOW TO GO TO WEB PAGE AFTER AUTHENTICATION? | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-605@lists.php.net to get a copy of this message | ||
"fopen" can open a web page (use fopen("http://domain.com/page.html", "r")
to open in READ mode), but will then just sit until you tell it what to do
next. You could add an fpassthru($fp) to dump that page's content out, but
thats pretty horrible.
Better would be to conditionally send a Location header to redirect the
client if authentication is successful, like
if ($authenticated) {
header("Location: http://domain.com/page.html");
exit;
}
else {
..
}
Chris Newman
Lightwood Consultancy Ltd
chris@lightwood.net
----- Original Message -----
From: Shawn Moore <smoore@stetson.edu>
To: <php-db@lists.php.net>
Sent: Saturday, June 24, 2000 5:08 PM
Subject: [PHP-DB] HOW TO GO TO WEB PAGE AFTER AUTHENTICATION?
> After I Authenticate a user using PHP/MYSQL, how do I make my IF/THEN
> statement point to another page if the AUTHENTICATION is successful?
> This is my if/then statement:
>
> if ($num != "0") {
> $fp = fopen("/test.html");
> exit;
>
> } else {
>
> header('WWW-Authenticate: Basic realm="Archibald Brothers"');
> header('HTTP/1.0 401 Unauthorized');
> echo 'Authorization Required.';
> exit;
>
> I have been trying fopen, but it does not seen to work.
>
> Thank you,
>
> Shawn
>
>
> --
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
> For additional commands, e-mail: php-db-help@lists.php.net
> To contact the list administrators, e-mail: php-list-admin@lists.php.net
>
>