commit
f5f2f8ef2b
@ -0,0 +1,3 @@
|
||||
FROM php:8.2-apache
|
||||
|
||||
COPY ./public_html/ /var/www/html/
|
@ -0,0 +1,50 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Login</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<h2>Connexion</h2>
|
||||
|
||||
<form method="post" action="">
|
||||
<label for="username">Nom d'utilisateur :</label>
|
||||
<input type="text" id="username" name="username" required><br><br>
|
||||
|
||||
<label for="password">Mot de passe :</label>
|
||||
<input type="password" id="password" name="password" required><br><br>
|
||||
|
||||
<input type="submit" value="Se connecter">
|
||||
</form>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
<?php
|
||||
function readUsersFile($filename) {
|
||||
$users = [];
|
||||
$file = fopen($filename, "r");
|
||||
if ($file) {
|
||||
while (!feof($file)) {
|
||||
$line = fgets($file);
|
||||
list($username, $password) = explode(':', trim($line));
|
||||
$users[$username] = $password;
|
||||
}
|
||||
fclose($file);
|
||||
}
|
||||
return $users;
|
||||
}
|
||||
|
||||
if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
||||
$username = $_POST['username'];
|
||||
$password = $_POST['password'];
|
||||
$users = readUsersFile('users.txt.lock');
|
||||
if (isset($users[$username]) && $users[$username] == md5($password) ){
|
||||
echo "Bienvenue, $username ! Vous êtes connecté.";
|
||||
} else {
|
||||
echo "Identifiants invalides. Veuillez réessayer.";
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -0,0 +1 @@
|
||||
Admin:0e904310212375757042757551233487
|
@ -1,3 +0,0 @@
|
||||
FROM httpd:alpine3.18
|
||||
|
||||
COPY ./public_html/ /usr/local/apache2/htdocs/
|
@ -1,29 +0,0 @@
|
||||
<?php
|
||||
|
||||
function readUsersFile($filename) {
|
||||
$users = [];
|
||||
$file = fopen($filename, "r");
|
||||
if ($file) {
|
||||
while (($line = fgets($file)) !== false) {
|
||||
list($username, $password) = explode(':', trim($line));
|
||||
$users[$username] = $password;
|
||||
}
|
||||
fclose($file);
|
||||
}
|
||||
return $users;
|
||||
}
|
||||
|
||||
if ($_SERVER["REQUEST_METHOD"] == "POST") {
|
||||
$username = $_POST['username'];
|
||||
$password = $_POST['password'];
|
||||
|
||||
$users = readUsersFile('users.txt.lock');
|
||||
|
||||
if (isset($users[$username]) && $users[$username] ==md5($password) ){
|
||||
echo "Bienvenue, $username ! Vous êtes connecté.";
|
||||
} else {
|
||||
echo "Identifiants invalides. Veuillez réessayer.";
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -1,22 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="fr">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Login</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<h2>Connexion</h2>
|
||||
|
||||
<form method="post" action="index.php">
|
||||
<label for="username">Nom d'utilisateur :</label>
|
||||
<input type="text" id="username" name="username" required><br><br>
|
||||
|
||||
<label for="password">Mot de passe :</label>
|
||||
<input type="password" id="password" name="password" required><br><br>
|
||||
|
||||
<input type="submit" value="Se connecter">
|
||||
</form>
|
||||
|
||||
</body>
|
||||
</html>
|
@ -1 +0,0 @@
|
||||
Admin:hello9323512300
|
Loading…
Reference in new issue