Never mind, i got it.
here it is for all those curious...
---begin auth.php
<?php
if (!isset($PHP_AUTH_USER)) {
Header("WWW-Authenticate: Basic realm=\"The Crazy Train\"");
Header("HTTP/1.0 401 Unauthorized");
echo "Error Logging In. Refresh to try again\n";
exit;
}
while ((!isset($auth)) || ($auth != 1)) {
$filename = "/path/to/webpass.txt"; //path to password list
$fd = fopen ($filename, "r"); //webpass.txt looks like this:
$i = 0; //username:password
for ($i = 0;!feof($fd);$i++) { //bob:fishing
$buffer[$i] = fgets($fd, 4096); //suzy:sewing
}
fclose ($fd);
$j=sizeof($buffer);
for ($i = 0;$i <= $j; $i++) { //breaks list apart into users and passwords
list( $user[$i], $pass[$i] ) = split( ":", $buffer[$i]);
$user[$i] = trim($user[$i]);
$pass[$i] = chop($pass[$i]);
if ((!strcasecmp($user[$i],$PHP_AUTH_USER)) && (!strcasecmp($pass[$i],$PHP_AUTH_PW))) {
$auth=1;
break;
}
}
if ($auth == 1) { break; }
else {
Header("WWW-Authenticate: Basic realm=\"The Crazy Train\"");
Header("HTTP/1.0 401 Unauthorized");
echo "Error Logging In. Refresh to try again\n";
exit;
}
}
?>
---end auth.php
one thing, be sure to upload your password list in ascii mode or else it screws up.