Re: Could u please check my source code?

From: Date: Sat, 23 Dec 2000 08:17:42 +0000
Subject: Re: Could u please check my source code?
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-31663@lists.php.net to get a copy of this message
your code is almost fine (with the exception being that $bfile[1] contains a newline which should be stripped with rtrim()... I just checked the example from the manual, and 4.0.4 DSO (Apache 1.3.15-dev) failed to let me in. I filed a bug report. (http://bugs.php.net/bugs.php?id=8388) At 08:44 23.12. 2000, nick wrote the following: -------------------------------------------------------------- >Hi ~ > >Is the following code anything wrong ???? >How come it doesn't work ??? > >Cheers, >nick > >index.php > ><? > >if (!isset($PHP_AUTH_USER)) { > >header('WWW-Authenticate: Basic realm="member area"'); >header('HTTP/1.0 401 Unauthorized'); > >echo 'enter ur name and password'; >exit; > >} else { > >$date = 'member.dat'; > >$afile = file($date); > >for($i = 0; $i < count($afile); $i++) { > >$bfile = explode("|", $afile[i]); > >while ($PHP_AUTH_USER == $bfile[0] and $PHP_AUTH_PW == $bfile[1]) { > >echo "get in!"; > >exit; > >} } } > >?> > >member.dat >myname|123 ------end of quote------ ____________________________________________________________ Cynic: A member of a group of ancient Greek philosophers who taught that virtue constitutes happiness and that self control is the essential part of virtue. cynic@mail.cz

« previous php.general (#31663) next »