Skip to content

Commit 4a258ea

Browse files
Add remember me functionality to login form
1 parent 5a1e5a9 commit 4a258ea

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

login.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,8 +60,14 @@
6060
<path d="M8 8a3 3 0 1 0 0-6 3 3 0 0 0 0 6Zm2-3a2 2 0 1 1-4 0 2 2 0 0 1 4 0Zm4 8c0 1-1 1-1 1H3s-1 0-1-1 1-4 6-4 6 3 6 4Zm-1-.004c-.001-.246-.154-.986-.832-1.664C11.516 10.68 10.289 10 8 10c-2.29 0-3.516.68-4.168 1.332-.678.678-.83 1.418-.832 1.664h10Z"></path>
6161
</svg></div>
6262
<form class="text-center" action="functions/login.php" method="post">
63-
<div class="mb-3"><input class="form-control" type="text" name="username" placeholder="Username"></div>
64-
<div class="mb-3"><input class="form-control" type="password" name="password" placeholder="Password"></div>
63+
<div class="mb-3"><input class="form-control" type="text" name="username" placeholder="Username" value="<?php echo isset($_COOKIE['username']) ? $_COOKIE['username'] : ''; ?>"></div>
64+
<div class="mb-3"><input class="form-control" type="password" name="password" placeholder="Password" value="<?php echo isset($_COOKIE['password']) ? $_COOKIE['password'] : ''; ?>"></div>
65+
<div class="mb-3">
66+
<input class="form-check-input" name="remember" type="checkbox" aria-label="remember" <?php echo isset($_COOKIE['username']) ? 'checked' : ''; ?>>
67+
<label class="form-check-label text-dark" for="remember">
68+
Remember me
69+
</label>
70+
</div>
6571
<div class="mb-3"><button class="btn btn-primary d-block w-100" type="submit">Login</button></div>
6672
<p class="text-muted">Laundry Management System (QRCode)</p>
6773
</form>

0 commit comments

Comments
 (0)