Commit 47125246 authored by Thibault VASSEUR's avatar Thibault VASSEUR
Browse files

Système de connexion fonctionnel

parent ce8fb867
<?php include('config.php'); ?>
<?php include('config.php');
<!DOCTYPE html>
<?php include('meta.php'); ?>
<title>iPok - Connexion/Inscription</title>
<?php include('meta.php');?>
<title>iPok - Connexion</title>
<?php include('nav.php'); ?>
<article style="width: 100%">
<div id="connect">
<form action="login.php" method="POST">
<label>Pseudonyme </label><br><input type="text" name="login"><br><br>
<label>Mot de passe </label><br><input type="password" name="password"><br><br>
<input type="submit" name="submit" value="Valider">
--><div id="lignevert">
--><div id="connect">
<form action="register.php" method="POST">
<label>Pseudonyme </label><br><input type="text" name="login"><br><br>
<label>Age </label><br><input type="number" name="age"><br><br>
<label>Email </label><br><input type="email" name="email"><br><br>
<label>Mot de passe </label><br><input type="password" name="password"><br><br>
<label>A nouveau mot de passe </label><br><input type="password" name="repeatpassword"><br><br>
<input type="hidden" name="MAX_FILE_SIZE" value="12345" />
<input type="submit" name="submit" value="Valider">
<?php include('nav.php');?>
<article style="text-align: center;">
$db = mysql_connect('localhost', 'thevasseur', 'vincis307');
$db = mysqli_connect('localhost', 'u745198619_ipok', 'droidcara', 'u745198619_ipok');
if (mysqli_connect_errno())
printf("Échec de la connexion : %s\n", mysqli_connect_error());
if(isset($_POST) && !empty($_POST['login']) && !empty($_POST['password']))
$_POST['password'] = hash("sha1", $_POST['password']);
$sql = "select password from membre where login='".$login."'";
$req = mysql_query($sql) or die('Erreur SQL !<br>'.$sql.'<br>'.mysql_error());
$data = mysql_fetch_assoc($req);
$req = mysqli_query($db, $sql) or die('Erreur SQL !<br>'.$sql.'<br>'.mysqli_error());
$data = mysqli_fetch_assoc($req);
if($data['password'] != $password)
echo '<br><div class="alert alert-dismissable alert-danger" style="text-align: center;">
echo '<br><div class="alert alert-dismissable alert-danger">
<button type="button" class="close" data-dismiss="alert">x</button>
Mauvais identifiant. Merci de recommencer!
Mauvais identifiant. Merci de recommencer !
$_SESSION['login'] = $login;
echo '<br><div class="alert alert-dismissable alert-success" style="text-align: center;">
echo '<br><div class="alert alert-dismissable alert-success">
<button type="button" class="close" data-dismiss="alert">×</button>
iPoK, connexion en cours... Redirection dans 3 secondes! <meta http-equiv="refresh" content="3; URL=index.php">
Vous etes bien connecté, Redirection dans 3 secondes ! <meta http-equiv="refresh" content="3; URL=index">
$champs = '<p><b>Remplissez tous les champs pour vous connectez !</b></p>';
<form action="login" method="POST" class="register">
<input type="text" name="login"><br><br>
Mot de passe<br>
<input type="password" name="password"><br><br>
<input type="submit" name="submit" value="Se connecter">
<?php include('footer.php'); ?>
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment