Re: Authenticate an user: Help!!!
| From: | Mercedes | Date: | Wed, 07 Nov 2001 18:57:48 +0000 |
| Subject: | Re: Authenticate an user: Help!!! | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-73634@lists.php.net to get a copy of this message | ||
If using the following code:
<?
Header("WWW-Authenticate: Basic realm=\$quot;mi Realm\"");
Header("HTTP/1.0 401 Unauthorized");
exit;
?>
it says:
Warning: Cannot add header information - headers already sent by (output
started at c:\apache\htdocs\foro\valida2.php:1) in
c:\apache\htdocs\foro\valida2.php on line 2
Warning: Cannot add header information - headers already sent by (output
started at c:\apache\htdocs\foro\valida2.php:1) in
c:\apache\htdocs\foro\valida2.php on line 3
Any idea??
"Mercedes" <mercedes@visualsies.com> escribió en el mensaje
news:20011106184047.68229.qmail@pb1.pair.com...
> I'm trying to authenticate an user and I use the following source
code:
>
> <?
> if(!isset($PHP_AUTH_USER)){
> Header("WWW-Authenticate: Basic realm=\$quot;mi Realm\"");
> Header("HTTP/1.0 401 Unauthorized")
> echo "TeXto para enviar si se utiliza el botón de Cancelar";
> exit;
> }else{
> echo " Hola $PHP_AUTH_USER <p>";
> echo " Tu contraseña es $PHP_AUTH_PW <p>";
> }
> ?>
>
>
> but it says: Parse error on line 6. I thing I have PHP like a CGI instead
> like a module, but I don´t really know. How can I know this? And how can I
> validate an user if using CGI mode?. Thanks
>
> aviana@wanadoo.es
>
>
>