Have you tested with
error_reporting(E_ALL);
Just to see if you can catch any erors/notices info from PHP.
Not showing all errors information when working with php scripts
is Totally CRAAAAAZZZYYYY & STUUUPID :eek:
Then after when you have a working script,
you can/should remove debugging scripting support..
Hopefully you already have error_reporting ON.
In such case, I am sorry for reminding you π
Try this, if you have disabled PHP Errors
<?php
error_reporting(E_ALL);// debug
ini_set('display_errors', true);// debug
if (!isset($PHP_AUTH_USER)) {
header('WWW-Authenticate: Basic realm="Restricted access"');
header('HTTP/1.0 401 Unauthorized');
echo 'Authorization Required.';
exit;
}
$fich = file("passwords.txt");
//...
//...
//...
You can put in this test.
Just to see that the explode works alright.
$fich = file("passwords.txt");
$i=0; $validado=false;
while ($fich[$i] && !$validado) {
$campo = explode("|",$fich[$i]);
echo '<pre>'; echo $i; print_r($campo); echo '<br />';// TEST of $campo values
if (($PHP_AUTH_USER==$campo[0]) && ($PHP_AUTH_PW==chop($campo[1]))) $validado=true;
$i++;
}