Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- header('Content-type: text/html; charset=utf-8');
- //---------------------------------------------------------
- // Requires fichiers database
- //---------------------------------------------------------
- require_once('../config/configuration.php');
- require_once('../config/baseDonnees.php');
- require_once('../config/fonctions.php');
- $titre = 'Liste des membres';
- require_once ("../inc/head.php");
- require_once ("../inc/header.php");
- ?>
- <style>
- div#form {
- width:250px;
- }
- </style>
- <?php
- if(isset($_POST['formconnexion']))
- {
- $mailconnect = htmlspecialchars($_POST['mailconnect']);
- $mdpconnect = sha1($_POST['mdpconnect']);
- if(!empty($mailconnect) AND !empty($mdpconnect))
- {
- $requser = $bdd->prepare("SELECT * FROM joueurs WHERE mail = ? AND mdp = ?");
- $requser->execute(array($mailconnect, $mdpconnect));
- $userexist = $requser->rowCount();
- if($userexist == 1)
- {
- $userinfo = $requser->fetch();
- $_SESSION['utilisateur'] = $userinfo['id'];
- $_SESSION['pseudo'] = $userinfo['pseudo'];
- $_SESSION['mail'] = $userinfo['mail'];
- header("Location: profil.php?id=".$_SESSION['utilisateur']);
- }
- else
- {
- $show->showError('<center>mauvais mail/pseudo ou mot de passe');
- }
- }
- else
- {
- $show->showError('<center>Tous les champs doivent etre complété');
- }
- }
- ?>
- <html>
- <head>
- <title>Connexion</title>
- <meta charset="utf-8">
- </head>
- <body>
- <div align="center">
- <h2>Connexion</h2>
- <br /><br />
- <form method="POST" action="">
- <div class="form-group" id="form">
- <label for="exampleInputEmail1">Adresse email ou pseudo</label>
- <input type="text" class="form-control" name="mailconnect" placeholder="email ou pseudo" id="mailconnect">
- </div>
- <div class="form-group" id="form">
- <label for="exampleInputPassword1">mot de passe</label>
- <input type="password" class="form-control" name="mdpconnect" placeholder="mot de passe" id="mdpconnect">
- </div>
- <button type="submit" name="formconnexion" class="btn btn-default">Se connecter</button>
- </form>
- <?php
- if(isset($erreur))
- {
- echo '<font color="red">'.$erreur."</font>";
- }
- ?>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement