-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconnexion.php
99 lines (54 loc) · 1.59 KB
/
connexion.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
93
94
95
96
97
98
99
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<title>Connexion</title>
<link rel="icon" href="ressources/menu/Notepad_Pencil_clip_art_hight.png">
<link rel="stylesheet" href="styles/connexion.css">
<link rel="stylesheet" href="styles/styles.css">
</head>
<body>
<?php
include("php/sql.php");
ConnectDatabase();
$loginStatus = CheckLogin();
//Si on est connecté on va sur notre page de blog
if (isset($username)) {
$query20 = "SELECT `ID` FROM `connexion` WHERE logname = '" . $username . "' ";
$result20 = $conn->query($query20);
$userID2 = $result20->fetch_assoc()["ID"];
echo '<script type="text/javascript">document.location.replace("./index.php?userID='.$userID2.'");</script>';
}
?>
<?php
include 'php/menu.php';
//On se connecte
if ($loginStatus[1]) {
echo '<h3 id="colorAnim" class="centre">' . $loginStatus[2] . '</h3>';
}
if ($loginStatus[0]) {
echo '<form action="./connexion.php" method="POST">
<div class="centre">
<input type="hidden" value="logout" name="logout"></input>
<button type="submit" class="bouton_co">Se déconnecter</button>
</div>
</form>';
if (isset($_POST["logout"])){
DestroyLoginCookie();
}
}
else {
include 'php/formulaire_connexion.php';
echo '
</br>
<div class="centre">
<a href="inscription.php">Créer un compte >></a>
</div>';
}
?>
<?php
include 'php/footer.php';
DisconnectDatabase();
?>
</body>
<script type="text/javascript" src="./js/messageErreur.js"></script>