1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77
|
<?php
require_once "config.inc.php";
if (isset($_POST['envoyer']))
{
if ($_POST['mdp']==$_POST['mdp2'] AND !empty($_POST['login']) AND !empty($_POST['mdp']) AND !empty($_POST['mail']))
{
connect_bd();
//$count=mysql_query("SELECT * from user where login='$_POST[login]'");
//$count2=mysql_num_rows($count);
//if ($count==0)
//{
mysql_query("INSERT INTO user VALUES (default, '$_POST[login]', sha1('$_POST[mdp]'), '$_POST[nom]', '$_POST[prenom]', '$_POST[mail]')");
mysql_close();
header('location:login.php');
//}
//else
//{
//$msg5="Pseudo déja utilisé!";
//}
}
if (isset($_POST['envoyer']))
{ if (empty($_POST['login']))
{
$error=$error['login'];
$msg1="<h4>Login absent !</h4>\n";
}
}
if (isset($_POST['envoyer']))
{ if (empty($_POST['mdp']))
{
$error=$error['mdp'];
$msg2="<h4>Mot de Passe absent !</h4>\n";
}
}
if (isset($_POST['envoyer']))
{ if (empty($_POST['mail']))
{
$error=$error['mail'];
$msg3="<h4>Mail absent !</h4>\n";
}
}
if (isset($_POST['envoyer']))
{ if ($_POST['mdp']!=$_POST['mdp2'])
{
$error=$error['mdp'];
$msg4="<h4>Confirmer votre Mot de Passe !</h4>";
}
}
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" charset="utf-8">
<head><title>Page d'inscription</title></head>
<body>
<?php
echo $msg1,$msg2,$msg3,$msg4,$msg5;
?>
<h1><center>Inscription d'un nouveau membre</center></h1>
<h6>*champs obligatoires</h6><BR>
<form action='' method="post">
<p>Login* : <input type="text" name="login"></p><BR>
<p>Mot de passe* : <input type="password" name="mdp">
Confirmation* : <input type="password" name="mdp2"></p><BR>
<p>Nom : <input type="text" name="nom">
Prénom : <input type="text" name="prenom"></p><BR>
<p>Mail* : <input type="text" name="mail"></p><BR>
<input type="submit" name="envoyer" value="S'inscrire">
</form>
</body>
</html> |
Partager