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

Maj 30/04

parent bbf11ad2
<?php include('config.php');
session_start();
session_unset();
session_destroy();?>
<!DOCTYPE html>
<html>
<head>
<?php include('meta.php');?>
<title>iPok - Inscription</title>
</head>
<body>
<?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)
{
$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
{
?>
<b><p style="text-align: center">Pseudo ou MDP vide !</p></b>
<?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>
Vous etes bien enregistré, Redirection dans 3 secondes ! <meta http-equiv="refresh" content="3; URL=index.php">
</div></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>
</article>
</body>
</html>
\ No newline at end of file
<div id="user">
<div id="titrearticle">
&nbsp;Utilisateur
</div><!--
--><div id="article">
<p>
<?php if(isset($_SESSION['login']))
{
echo "Vous êtes $login.";
}
else
{
echo 'Les informations de l\'utilisateur seront bientôt disponible. Pour cela il sera nécessaire de vous connectez au site.';
}?>
</div>
</div>
\ 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