If tried to add a condition to a web page that counts how many times someone tries to log in. I want the value of counter to go up only when I reload the page. When I set the value of $counter to 0, it comes back with 0. If I have it go through a different page it comes back as one, but that would mean going through a different page each time.
I'm so confused with it all
Code: Select all
<?php
$counter = $counter++;
echo $counter;
if ($counter == 0) {
echo $form;}
elseif (($counter > 0) && ($counter < 5)) {
echo "<p>Sorry but that username and password combination is not valid. Please try again.</p>";
echo $form;}
else {
echo "<p>Sorry, you have exceeded the allocated number of attempts for authorisation. Please contact the <a href=\"admin.php\">administrator</a>.</p>";
}
?>