I've installed the last version of xampp for windows (XP) on C: directory (C:\xampp) without installer. I've executed setup-xampp.bat and then the xampp_start.exe. All works fine (db, php pages, etc) but I can't use any protected page with authentication.
My authentication page is like this:
<?php
if(!isset($PHP_AUTH_USER) || $PHP_AUTH_USER=="" || $PHP_AUTH_PW=="") {
pone();
} else {
$pasado=false;
if ($PHP_AUTH_USER=='user01' && $PHP_AUTH_PW =='passw$01'|| $PHP_AUTH_USER=='admin' && $PHP_AUTH_PW =='superadmin?01' ){
session_start();
$_SESSION['tipo']=99;
header ('location:menu.php');
exit;
}
if ($pasado==false){
//session_destroy();
unset($PHP_AUTH_USER);
unset($PHP_AUTH_USER);
pone();
}
exit;
}
function pone(){
Header("WWW-Authenticate: Basic realm=\"Inscripcions al Congrés\"");
Header("HTTP/1.0 401 Unauthorized");
echo "No ha entrado un nombre de usuario o contraseña correcta";
echo "<p>";
echo "<a href=localhost/congres/manteniment'>Volver a intentar</a>";
exit;
}
?>
This page is named "index.php" in "manteniment" directory. Well, when I go here (localhost/congres/manteniment/index.php) comes the window for username and password. I write 'user01' and 'passw$01' but the system doesn't accept it.
This script works fine with an other computer (xp too) and an older version of xampp (I think it's a 1.4.x version)
Why this script doesn't work now?
Thanks.