/
index.php
executable file
·55 lines (48 loc) · 1.87 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
<?php
require('fonctions.php');
include_once controleLang();
//We will call the connection function only if we have correct ID and password
if(isset($_POST['id']) && isset($_POST['mdp']))
{
if(connexion($_POST['id'], $_POST['mdp']))
header("Location:accueil.php");
else
header("Location:accueil.php?action=deco"); //If not, we call the function deconnection that will appear like a page refreshing
}
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<!-- > Titre de la page, apparait sur l'onglet de la page <-->
<title> <?php echo $lang['PAGE_TITLE']; ?></title>
<!-- insertion du css-->
<link rel="stylesheet" href="bootstrap.min.css">
</head>
<body>
<!-- > Création d'un formulaire de connexion, on utilisera la methode post <-->
<div class="container">
<!-- > Texte d'explication <-->
<h3> <?php echo $lang['ID']; ?> </h3>
<form class="form-horizontal" method="post" action="index.php">
<div class="form-group">
<label class="control-label col-sm-2" for="id" class="col-sm-2 control-label"> <?php echo $lang['ID_FIELD']; ?> </label>
<div class="col-sm-4">
<input type="text" class="form-control" id="id" name="id" value="<?php if(isset($_COOKIE['id'])) echo $_COOKIE['id']?>" placeholder="<?php echo $lang['ID_FIELD']?>">
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2" for="mdp" class="col-sm-2 control-label"> <?php echo $lang['PASSWORD_FIELD']; ?> </label>
<div class="col-sm-4">
<input type="password" class="form-control" id="mdp" name="mdp" placeholder="<?php echo $lang['PASSWORD_FIELD']?>">
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<button type="submit" class="btn btn-primary" value="Connexion"> <?php echo $lang['LOGIN']; ?> </button>
</div>
</div>
</form>
</div>
</body>
</html>