I am not sure I understand what you mean.
Anyway, here is the code I am trying to use, which is not working:
/ $user_login and $user_pass are established earlier in the script. /
<?php
function login(&$count)
{
global $PHP_AUTH_USER, $PHP_AUTH_PW, $user_login, $user_pass, $count;
if (!isset ($PHP_AUTH_USER) )
{
header("WWW-Authenticate: Basic realm=\"$user\"");
header("HTTP/1.0 401 Unauthorized");
{print "Operation canceled\n";} exit;
}
else
{
if ( ($PHP_AUTH_USER == $user_login) && ($PHP_AUTH_PW == $user_pass) )
{$count = '4';}
else {print '<p>Login error. Access denied.</p>';}
unset ($PHP_AUTH_USER, $PHP_AUTH_PW); $count++;
}
}
}
// <!-- -------------------------- -->
global $HTTP_REFERER;
if (preg_match ("/http:\/\/127.0.0.1\//", "$HTTP_REFERER") )
{$go_ahead = 'go_ahead';}
else {$count = 0; while ($count < 3) {login($count);} }
print "count = $count<br>"; // just to check if counter is working
if ($count <= 3) {die();}
else {$go_ahead = 'go_ahead';}
?>
Ideas?
Thank you,
Luciano ES
Santos, SP - Brasil