-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathseConnecter.php
154 lines (147 loc) · 3.07 KB
/
seConnecter.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
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
<?php
session_start();
@$login=$_POST["login"];
@$mdp=$_POST["mdp"];
@$valider=$_POST["valider"];
$erreur="";
if(isset($valider))
{
try {include("connexion.php");
$ses=$pdo->prepare("select Id, Nom,carteNatio from Laureats where Nom=? AND carteNatio=? ");
$ses->execute(array($login,$mdp));
@$donnees=$ses->fetch();
if($donnees["Nom"]==$login && $donnees["carteNatio"]==$mdp)
{
$_SESSION['Id']=$donnees["Id"];
header("location:session.php");
}
else
{if($login!="admin" || $mdp!="admin")
$erreur="Mauvais login ou mot de passe";
if(empty($erreur))
header("location:BaseDeDonnee.php");
}
}
catch(PDOException $e){
echo $e->getMessage();
}
}
?>
<!DOCTYPE html>
<html>
<head>
<style>
body
{
margin:0;
}
#conteneur
{
margin:0;
padding:10px;
background:linear-gradient(to bottom,#DDDDDD,#FFFFFF);
background-repeat:no-repeat;
}
.fieldset
{
margin:10px;
border:none;
background-color:#FFFFFF;
border-radius:10px;
padding:20px;
}
.legend
{
font-family:verdana, arial, sans-serif;
font-size:14pt;
font-weight:bold;
color:#FFFFFF;
margin:10px;
padding:10px 20px 10px 20px;
background-color:#AAAAAA;
border-radius:4px;
transform:translate(400px,0px);
}
.label
{
display:inline-block;
width:250px;
font-family:verdana, arial, sans-serif;
font-size:18pt;
padding:10px;
}
.input
{
display:inline-block;
padding:6px;
}
.champ
{
outline:none;
border:solid 1px #AAAAAA;
padding:10px;
border-radius:4px;
font-family:verdana, arial, sans-serif;
}
input[type="submit"].champ
{
background-color:#EE6600;
color:#FFFFFF;
padding:6px 20px 6px 20px;
border:none;
cursor:pointer;
padding:10px;
width:480px;
transform:translate(0px,20px);
}
#erreur
{
position:fixed;
min-width:300px;
min-height:20px;
padding:20px;
background-color:#EE6600;
color:#FFF;
right:0;
top:200px;
border-radius:10px 0 0 10px;
}
#conteneur2
{
transform:translate(380px, 100px);
}
#titre
{
font-family:verdana, arial, sans-serif;
font-size:16pt;
font-weight:bold;
color:#EE6600;
margin:10px;
padding:10px 20px 10px 300px;
border-radius:4px;
}
</style>
</head>
<body>
<div id="conteneur">
<header id="titre"> Associtation des anciens étudiant de l'ENSA de Marrakech </header>
<form name="fo" method="post" action="">
<fieldset class="fieldset">
<legend class="legend">Authentification</legend>
<div id="conteneur2">
<div class="label">Login </div>
<div class="input"><input type="text" name="login" value="<?php echo $login?>" class="champ" /> </div> <br />
<div class="label">Mot de passe</div>
<div class="input"> <input type="password" name="mdp" class="champ" /> </div> <br />
<div class="input"> <input type="submit" name="valider" value="valider" class="champ"/> </div> <br />
</div>
</fieldset>
</form>
</div>
<?php if(!empty($erreur)){ ?>
<div id="erreur">
<?php echo $erreur ?>
</div>
<?php } ?>
</body>
</html>