sacha.serny 3 years ago
parent
commit
dbcf5c54f4
  1. 12
      index.php

12
index.php

@ -1,12 +1,15 @@
<?php <?php
if (isset($_POST['submit'])) { if (isset($_POST['submit'])) {
if (isset($_POST['username']) AND isset($_POST[username])) { if (isset($_POST['username']) AND isset($_POST[username])) {
$username = htmlspecialchars($_POST['username']) $username = htmlspecialchars($_POST['username']);
$password = htmlspecialchars($_POST['password']) $password = htmlspecialchars($_POST['password']);
if ($password == "NSI") { if ($password == "NSI") {
setcookie("logged", $username, 120) $message = "redirection en cours";
header('location: google.fr') setcookie("logged", $username, 120);
header('location: machine.html');
} else {
$message ="accès refusé";
} }
} }
} }
@ -27,6 +30,7 @@ if (isset($_POST['submit'])) {
<input type="text" name="password"> <input type="text" name="password">
<input type="submit" value="Valider" name="submit"> <input type="submit" value="Valider" name="submit">
</form> </form>
<?php if (isset($message)) {echo $message;} ?>
</div> </div>
</body> </body>
</html> </html>

Loading…
Cancel
Save