Could u please check my source code?
| From: | nick | Date: | Sat, 23 Dec 2000 07:44:14 +0000 |
| Subject: | Could u please check my source code? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-31661@lists.php.net to get a copy of this message | ||
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