-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
92 lines (82 loc) · 2.86 KB
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
<?php include 'header.php'; ?>
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<title>Titre de la page</title>
<link rel="stylesheet" href="style.css">
<head>
<body>
<div id="login-container">
<h2>Connexion</h2>
<form action="acceuil.php" method="post">
<div class="form-group">
<label for="username">Nom d'utilisateur :</label>
<input type="text" id="username" name="username" required placeholder="DrSanté">
</div>
<div class="form-group">
<label for="password">Mot de passe :</label>
<input type="password" id="password" name="password" required placeholder="••••••••">
</div>
<div class="form-group">
<li><button href="acceuil.php">Se connecter</button></li>
</div>
</form>
</div>
<script src="login.js"></script>
</body>
</html>
<?php
// include 'header.php';
// Database connection
//$conn = new mysqli('localhost', 'root', 'Holoreed25&*', 'holoreed');
//$conn->set_charset("utf8mb4");
// // Check for form submission
// if ($_SERVER["REQUEST_METHOD"] == "POST") {
// $username = $_POST['username'];
// $password = $_POST['password']; // Remember to hash the password in real scenarios
// // Prepare SQL statement to prevent SQL injection
// $stmt = $conn->prepare("SELECT * FROM User WHERE Username = ? AND Password = ?");
// $stmt->bind_param("ss", $username, $password);
// $stmt->execute();
// $result = $stmt->get_result();
// if ($result->num_rows > 0) {
// // User found, proceed to home.php
// header("Location: home.php");
// } else {
// // User not found, show error
// echo "<p>Invalid username or password</p>";
// }
// $stmt->close();
// }
// // Close connection
// $conn->close();
// ?>
<!--
// <!DOCTYPE html>
// <html lang="fr">
// <head>
// <meta charset="UTF-8">
// <title>Titre de la page</title>
// <link rel="stylesheet" href="style.css">
// </head>
// <body>
// <div id="login-container">
// <h2>Connexion</h2>
// <form action="index.php" method="post">
// <div class="form-group">
// <label for="username">Nom d'utilisateur :</label>
// <input type="text" id="username" name="username" required placeholder="DrSanté">
// </div>
// <div class="form-group">
// <label for="password">Mot de passe :</label>
// <input type="password" id="password" name="password" required placeholder="••••••••">
// </div>
// <div class="form-group">
// <button type="submit">Se connecter</button>
// </div>
// </form>
// </div>
// <script src="login.js"></script>
// </body>
// </html> -->