Commit 9589c8e9 authored by Vassouille's avatar Vassouille
Browse files

Mise à jour finale pour examen

parent e0796dfc
......@@ -12,76 +12,68 @@ session_destroy();?>
<?php include('nav.php');?>
<article style="text-align: center;">
<?php
try
{
$bdd = new PDO ('mysql:host=localhost;dbname=u745198619_ipok', 'u745198619_ipok', 'droidcara');
}
catch(Exception $e)
{
die('Erreur :'.$e->getMessage());
}
if(ISSET($_POST['submit']))
{
$login = $_POST['login'];
$age = $_POST['age'];
$email = $_POST['email'];
$password = $_POST['password'];
$repeatpassword = $_POST['repeatpassword'];
if($repeatpassword = $password)
try
{
$password = hash("sha1", $password);
$req = $bdd->prepare('INSERT INTO membre(login, password, age, email) VALUES (:login, :password, :age, :email)');
$req->execute(array("login" => $login, "password" => $password, "age" => $age, "email" => $email));
if(!empty($login) && !empty($password))
{
}
else
$bdd = new PDO ('mysql:host=localhost;dbname=u745198619_ipok', 'u745198619_ipok', 'droidcara');
}
catch(Exception $e)
{
die('Erreur :'.$e->getMessage());
}
if(ISSET($_POST['submit']))
{
$login = $_POST['login'];
$age = $_POST['age'];
$email = $_POST['email'];
$password = $_POST['password'];
$repeatpassword = $_POST['repeatpassword'];
if($repeatpassword = $password)
{
?>
$password = hash("sha1", $password);
$req = $bdd->prepare('INSERT INTO membre(login, password, age, email) VALUES (:login, :password, :age, :email)');
$req->execute(array("login" => $login, "password" => $password, "age" => $age, "email" => $email));
if(!empty($login) && !empty($password) && !empty($email) && !empty($repeatpassword) && !empty($age))
{}
else
{
?>
<b><p style="text-align: center">Pseudo ou MDP vide !</p></b>
<?php
}
if(empty($login) && empty($password))
{
<?php
}
if(empty($login) && empty($password))
{}
else
{
session_start();
$_SESSION['login'] = $_POST['login'];
header('Refresh: 3; URL=index');
echo '<p style="text-align: center; color: white;"><div class="alert alert-dismissable alert-success" class="register">
<button type="button" class="close" data-dismiss="alert">×</button>
Votre iP me semble correcte, inscription admise dans 2 secondes...<meta http-equiv="refresh" content="2; URL=index.php">
</div></p>';
}
}
else
{
session_start();
$_SESSION['login'] = $_POST['login'];
header('Refresh: 3; URL=index');
echo '<p style="text-align: center"><div class="alert alert-dismissable alert-success">
<button type="button" class="close" data-dismiss="alert">×</button>
Vous etes bien enregistré, Redirection dans 3 secondes ! <meta http-equiv="refresh" content="3; URL=index.php">
</div></p>';
}
echo '<p style="text-align: center">Mot de passe non valide</p>';
}
}
else
{
echo '<p style="text-align: center">Mot de passe non valide</p>';
}
}
?>
<form action="register.php" method="POST" class="register">
<p>
Pseudonyme<br>
<input type="text" name="login"><br><br>
Age<br>
<input type="number" name="age"><br><br>
Email@<br>
<input type="email" name="email"><br><br>
Mot de passe<br>
<input type="password" name="password"><br><br>
RE - Mot de passe<br>
<input type="password" name="repeatpassword"><br><br>
<input type="submit" name="submit" value="S'inscrire">
</p>
</form>
?>
<form action="register.php" method="POST" class="register">
<p>
Pseudonyme<br>
<input type="text" name="login" required><br><br>
Age<br>
<input type="number" name="age" required><br><br>
Email@<br>
<input type="email" name="email" required><br><br>
Mot de passe<br>
<input type="password" name="password" required><br><br>
RE - Mot de passe<br>
<input type="password" name="repeatpassword" required><br><br>
<input type="submit" name="submit" value="S'inscrire">
</p>
</form>
</article>
</body>
</html>
\ 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