We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0785467 commit 86cebd5Copy full SHA for 86cebd5
unzip.php
@@ -4,6 +4,11 @@
4
session_start();
5
$username = 'vue';
6
$password = '123456';
7
+$maxWrongAttempts = 100;
8
+if (isset($_SESSION['wrong_attemtps_count']) && $_SESSION['wrong_attemtps_count'] > $maxWrongAttempts) {
9
+ die('Too many attempts');
10
+}
11
+
12
$_SESSION['message'] ='';
13
if ($_SERVER['REQUEST_METHOD'] == 'POST' && isset($_POST) && isset($_POST['logout'])) {
14
session_destroy();
@@ -16,6 +21,10 @@
16
21
$_SESSION['username'] = $username;
17
22
} else {
18
23
$_SESSION['message'] ='Username or password is wrong';
24
+ if (!isset($_SESSION['wrong_attemtps_count'])) {
25
+ $_SESSION['wrong_attemtps_count'] = 0;
26
+ }
27
+ $_SESSION['wrong_attemtps_count']++;
19
28
}
20
29
30
0 commit comments