Browse Source

Gestion de sessions référant

master
BARRAUX Arthur 3 years ago
parent
commit
f6bd4da144
  1. 13
      index.php
  2. 16
      session_restraintes.php

13
index.php

@ -0,0 +1,13 @@
<!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>

16
session_restraintes.php

@ -0,0 +1,16 @@
<?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);
header('location: ../index.php');
}
?>
Loading…
Cancel
Save