This repository has been archived by the owner on Nov 23, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
login.php
92 lines (76 loc) · 2.61 KB
/
login.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
session_start();
include_once "./expiring_session.php";
if (isset($_SESSION['login']) && isset($_SESSION['pwd'])) {
HEADER("location:./home.php");
}
?>
<html>
<head>
<?php
include_once("./head.html");
?>
<title>Se connecter</title>
</head>
<body>
<?php
$page_actuel = "login";
include "./header.php";
?>
<div class="structure">
<div id="body">
<aside id="right_column">
<div id="rightbar_content">
<a
<?php
if(isset($_GET['target'])){
echo " href='./signup.php?target=" . $_GET['target'] . "'.";
}else{
echo " href='./signup.php";
}
?>
class="signup_button">
<p>S'INSCRIRE</p>
</a>
</div>
</aside>
<section>
<article class="centre">
<h1>Connectez-vous</h1>
</article>
<?php
if(isset($_GET['target'])) {
echo "<marquee behavior='scroll' bgcolor='red' loop='-1' width='100%' scrollamount='10' style='color:#ffffff; font-weight: bold; font-size: x-large;'>
Vous devez être connecté pour accéder à cette page
</marquee>";
echo"<article>";
echo "<form action='./treat-login.php?target=" . $_GET['target'] . "' method=POST>";
}else{
echo "<article>";
echo "<form action='./treat-login.php' method=POST>";
}
?>
<label>E-mail : </label><input type="email" name="mail" size="30" maxlength="40" value=""><br><br>
<label>Password : </label><input type="password" name="pwd" size="30" maxlength="40"
value=""><br><br>
<button type="reset">Effacer</button>
<button type="submit">Connexion</button>
</form>
<?php
if (!empty($_GET['fail']) && $_GET['fail'] == "yes") {
echo "Vous vous êtes mal connecté";
echo "<script type='text/javascript'>alert('Erreur de connexion !');</script>";
}
if (!empty($_GET['fail']) && $_GET['fail'] == "no") {
echo "Vous vous êtes bien inscrit";
}
?>
</article>
</section>
</div>
</div>
<?php
include "./footer.php";
?>
</body>
</html>