BARRAUX Arthur
3 years ago
14 changed files with 233 additions and 280 deletions
@ -1,13 +0,0 @@ |
|||
<!DOCTYPE html> |
|||
<html> |
|||
<head> |
|||
<title>Login</title> |
|||
</head> |
|||
<body> |
|||
<form action="login.php" method="post"> |
|||
Login: <input type="text" name="login"><br> |
|||
Pwd: <input type="password" name="pwd"><br> |
|||
<input type="submit" value="conexion"> |
|||
</form> |
|||
</body> |
|||
</html> |
@ -1,26 +0,0 @@ |
|||
<?php |
|||
|
|||
$login = [['prof', 'arthur'], ['referant', 'azerty']]; |
|||
echo $login[0][0]; |
|||
|
|||
if (isset($_POST['login']) && isset($_POST['pwd'])) { |
|||
if ($login[0][0] == $_POST['login'] && $login[0][1] == $_POST['pwd']) { |
|||
session_start(); |
|||
$_SESSION['login'] = $_POST['login']; |
|||
$_SESSION['pwd'] = $_POST['pwd']; |
|||
header('location: prof/index.php'); |
|||
} |
|||
elseif ($login[1][0] == $_POST['login'] && $login[1][1] == $_POST['pwd']) { |
|||
session_start(); |
|||
$_SESSION['login'] = $_POST['login']; |
|||
$_SESSION['pwd'] = $_POST['pwd']; |
|||
header('location: prof/index.php'); |
|||
} |
|||
else { |
|||
echo '<meta http-equiv="refresh" content="0;URL=index.php">'; |
|||
} |
|||
} |
|||
else { |
|||
echo 'c vide'; |
|||
} |
|||
?> |
@ -0,0 +1,19 @@ |
|||
<?php |
|||
if (isset($_POST['login']) && isset($_POST['pwd'])) { |
|||
$bdd = new PDO('mysql:host=localhost;dbname=ticket;charset:utf8', 'root', ''); |
|||
|
|||
$reponse = $bdd->query("SELECT * FROM logins"); |
|||
|
|||
while ($line = $reponse->fetch()) { |
|||
if ($line[0] == $_POST['login'] && $line[1] == $_POST['pwd']) { |
|||
session_start(); |
|||
$_SESSION['login'] = $_POST['login']; |
|||
$_SESSION['pwd'] = $_POST['pwd']; |
|||
header('location: ../prof/index.php'); |
|||
} |
|||
} |
|||
} |
|||
|
|||
echo '<meta http-equiv="refresh" content="0;URL=index.php">'; |
|||
|
|||
?> |
@ -0,0 +1,31 @@ |
|||
<!DOCTYPE html> |
|||
<html> |
|||
<head> |
|||
<title>Login</title> |
|||
<link rel="stylesheet" href="../stylepage.css"> |
|||
</head> |
|||
<body> |
|||
<form id='form' action="cible.php" method="post"> |
|||
<div class="container-champ"> |
|||
<p>Login:</p> |
|||
<div class="champ"> |
|||
<select class="entry" name="login"> |
|||
<option value="prof">prof</option> |
|||
<option value="referant">Référant</option> |
|||
</select> |
|||
</div> |
|||
</div> |
|||
<div class="container-champ"> |
|||
<p>Pwd:</p> |
|||
<div class="champ"> |
|||
<input class="entry" type="password" name="pwd"> |
|||
</div> |
|||
</div> |
|||
<div class="container-champ"> |
|||
<div class="champ"> |
|||
<input class="entry" type="submit" value="conexion"> |
|||
</div> |
|||
</div> |
|||
</form> |
|||
</body> |
|||
</html> |
@ -1,146 +0,0 @@ |
|||
head{ |
|||
display: inline-table; |
|||
} |
|||
|
|||
a{ |
|||
color: #2ecc71; |
|||
} |
|||
|
|||
body{ |
|||
z-index: 1; |
|||
background-color: #e5e5e5; |
|||
margin: 20px; |
|||
text-align: center; |
|||
} |
|||
|
|||
.logo{ |
|||
display: block; |
|||
} |
|||
|
|||
h1{ |
|||
margin: 40px; |
|||
font-weight: bold; |
|||
color: #454545; |
|||
} |
|||
|
|||
p{ |
|||
font-weight: bold; |
|||
color: #454444; |
|||
font-size: 20px; |
|||
height: 20px; |
|||
} |
|||
|
|||
form{ |
|||
width: 400px; |
|||
position: relative; |
|||
background-color: #ffffff; |
|||
display: block; |
|||
margin: auto; |
|||
border-radius: 30px; |
|||
padding: 20px; |
|||
} |
|||
|
|||
.container-champ{ |
|||
position: relative; |
|||
} |
|||
|
|||
.container-champ small{ |
|||
display: none; |
|||
color: red; |
|||
} |
|||
|
|||
.champ{ |
|||
background-color: inherit; |
|||
display: flex; |
|||
position: relative; |
|||
text-decoration-line: none; |
|||
flex-direction: row-reverse; |
|||
text-align: center; |
|||
color: #454444; |
|||
display: block; |
|||
margin: 10px auto; |
|||
border: 4px solid #4e4d4d; |
|||
padding: 10px 10px; |
|||
width: 200px; |
|||
border-radius: 30px; |
|||
transition: 0.25s; |
|||
} |
|||
|
|||
.entry{ |
|||
border: none; |
|||
resize: none; |
|||
outline: none; |
|||
width: 100%; |
|||
text-align: inherit; |
|||
background-color: inherit; |
|||
-webkit-appearance: none; |
|||
-moz-appearance: none; |
|||
appearance: none; |
|||
} |
|||
|
|||
.champ:focus, .champ:hover{ |
|||
width: 300px; |
|||
border-color: #ac2a8d; |
|||
background-color: #dddddd; |
|||
} |
|||
|
|||
.champ img{ |
|||
display: none; |
|||
position: relative; |
|||
float: right; |
|||
width: 20px; |
|||
bottom: 20px; |
|||
right: 20px; |
|||
} |
|||
|
|||
.submit{ |
|||
background-color: inherit; |
|||
display: flex; |
|||
position: relative; |
|||
flex-direction: row-reverse; |
|||
text-align: center; |
|||
color: #454444; |
|||
display: block; |
|||
margin: 10px auto; |
|||
border: 4px solid #4e4d4d; |
|||
padding: 10px 10px; |
|||
width: 200px; |
|||
border-radius: 30px; |
|||
transition: 0.25s; |
|||
} |
|||
|
|||
.submit:hover{ |
|||
width: 250px; |
|||
background-color: #82E6AC; |
|||
border-color: #2ecc71; |
|||
} |
|||
|
|||
.help{ |
|||
display: none; |
|||
z-index: 2; |
|||
position: absolute; |
|||
width: 170px; |
|||
right: 0; |
|||
top: 30%; |
|||
border-radius: 30px; |
|||
padding: 15px; |
|||
margin: 0; |
|||
background-color: #dddddd; |
|||
|
|||
} |
|||
|
|||
.help * { |
|||
font-size: 14px; |
|||
width: 100%; |
|||
} |
|||
|
|||
.help p{ |
|||
position: relative; |
|||
} |
|||
|
|||
code { |
|||
background-color: #aaa; |
|||
border-radius: 5px; |
|||
font-family: courier, monospace; |
|||
padding: 3px 5px; |
|||
} |
@ -1,4 +1,4 @@ |
|||
<meta charset="utf-8"> |
|||
<title>Admin ticket</title> |
|||
<link href="stylepage.css" rel="stylesheet"> |
|||
<link href="../stylepage.css" rel="stylesheet"> |
|||
<img class="logo" src="../img/logo_PC.png" alt="logo_PC" width="200px"> |
|||
|
@ -1,10 +1,6 @@ |
|||
<?php |
|||
session_start(); |
|||
if (isset($_SESSION['login']) && isset($_SESSION['pwd'])) { |
|||
echo 'vous etes autentifié'; |
|||
} |
|||
else{ |
|||
if (!isset($_SESSION['login']) || !isset($_SESSION['pwd'])) { |
|||
header('location: ../index.php'); |
|||
|
|||
} |
|||
?> |
@ -1,16 +1,6 @@ |
|||
<?php |
|||
session_start(); |
|||
if (isset($_SESSION['login']) && isset($_SESSION['pwd'])) { |
|||
if ($_SESSION['login'] == 'referant') { |
|||
echo 'vous êtes référant'; |
|||
} |
|||
else { |
|||
echo 'vous etes autentifié'; |
|||
} |
|||
} |
|||
else{ |
|||
print_r($_SESSION); |
|||
if ( !(isset($_SESSION['login']) && isset($_SESSION['pwd'])) && !($_SESSION['login'] == 'referant')) { |
|||
header('location: ../index.php'); |
|||
|
|||
} |
|||
?> |
Loading…
Reference in new issue