M
Matthieu D.
Je débute en php/html pouvez-vous me dire les erreurs de sintaxes ?
Code:
<?php
if(isset($_POST['forminscription']))
{
$pseudo = htmlspecialchars($_POST['pseudo']);
$mail = htmlspecialchars($_POST['mail']);
$mail2 = htmlspecialchars($_POST['mail2']);
$mdp = sha1($_POST['mdp']);
$mdp2 = sha1($_POST['mdp2']);
{
if($mdp == $mdp2)
{
echo "Nickel";
}
else
{
$erreur = "Vos mot de passes ne correspondent pas !";
if(filter_var($mail,FILTER_VALIDATE_EMAIL))
{
}
else
{
$erreur = "Votre adresse mail n'est pas valide !";
}
if($mail == $mail2)
{
$erreur = "Vos adresses e-mail de correspondent pas !";
$pseudolength = strlen($pseudo);
if($pseudolength <=255)
{
}
else
{
$erreur = "Votre pseudo ne doit pas dépasser 255 caractères !";
}
if(!empty($_POST['pseudo']) AND !empty($_POST['mail']) AND !empty($_POST['mail2']) AND !empty($_POST['mdp']) AND !empty($_POST['mdp2']))
{
}
else
{
$erreur = "Tous les champs doivent être compléter !";
}
}
?>
<html>
<head>
<title>Inscription</title>
<meta charset="utf-8">
</head>
<body>
<div align="center">
<h2>Inscription</h2>
<br /><br /><br />
<form method="POST" action="">
<table>
<tr>
<td align="right">
<label for="pseudo">Pseudo :</label>
</td>
<td>
<input type="text" placeholder="Votre pseudo" id="pseudo" name="pseudo" value="<?php if(isset($pseudo)) { echo $pseudo; } ?>" />
</td>
</tr>
<tr>
<td align="right">
<label for="mail">Mail :</label>
</td>
<td>
<input type="text" placeholder="Votre mail" id="mail" name="mail" value="<?php if(isset($mail)) { echo $mail; } ?>"/>
</td>
</tr>
<tr>
<td align="right">
<label for="mail">Confirmation du mail :</label>
</td>
<td>
<input type="text" placeholder="Confirmation du mail" id="mail2" name="mail2" value="<?php if(isset($mail2)) { echo $mail2; } ?>"/>
</td>
</tr>
<tr>
<td align="right">
<label for="mdp">Mot de passe :</label>
</td>
<td>
<input type="text" placeholder="Mot de passe" id="mdp" name="mdp" />
</td>
</tr>
<tr>
<td align="right">
<label for="mdp2">Confirmation mot de passe :</label>
</td>
<td>
<input type="text" placeholder="Confirmation du mot de passe" id="mdp2" name="mdp2" />
</td>
</tr>
<tr>
<td></td>
<td>
<br />
<input type="submit" name="forminscription" value="Je m'inscris">
</td>
</tr>
</table>
</form>
<?php
if(isset($erreur))
{
echo '<font color="red">'.$erreur."</font>";
}
?>
</div>
</body>
Dernière édition par un modérateur: