Unexpected T_IF

Fermé
Benjamin - Modifié par Benjamin le 1/12/2015 à 22:20
Pitet Messages postés 2826 Date d'inscription lundi 11 février 2013 Statut Membre Dernière intervention 21 juillet 2022 - 2 déc. 2015 à 15:59
Bonjour, j'ai un problème avec mon codage j'ai une erreur qui s'intitule Parse error: syntax error, unexpected T_IF in C:\Program Files (x86)\Ampps\www\Site\formulaire.php on line 7


Merci d'avance pour votre aide :D
Mon code est le suivant:

<?php



$bdd = new PDO('mysql:host=127.0.0.1;dbname=espace_membre', 'root ,');

if(isset($_POST['forminscription']))
{
echo "Vous étes bien inscrits merci !!"
}
else
{
$erreur = "Tout les champs doivent etre completer!!"
}
if(!empty(($_POST[pseudo]) AND) if(!empty(($_POST[mail]) AND if(!empty(($_POST[mail2]) AND if(!empty(($_POST[mdp]) AND if(!empty(($_POST[mdp2]) AND
$pseudo = htmlspecialchars($_POST['pseudo']);
$mail = htmlspecialchars($_POST['mail']);
$mail2 = htmlspecialchars($_POST['mail2']);
$mdp = sha1($_POST['mdp']);
$mdp2 = sha1($_POST['mdp2']);
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<link rel="stylesheet" type="text/css" href="css/styles.css"/>
<title>iReYaX- Forum </title>
</head>
<body>
<div align="center">
<h2>Inscription</h2>
<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"/>
</form>
</td>
</tr>

<tr>
<td align="right">
<label for="mail">E-mail :</label>
</td>

<td>
<input type="email" placeholder="Votre e-mail" id="mail" name="mail"/>
</form>
</td>
</tr>

<tr>
<td align="right">
<label for="mail2">Confirmer l'e-mail :</label>
</td>

<td>
<input type="email" placeholder="Confirmer votre e-mail" id="mail2" name="mail2"/>
</form>
</td>
</tr>

<tr>
<td align="right">
<label for="mdp">Votre Mot De Passe :</label>
</td>

<td>
<input type="password" placeholder="Votre Mot De Passe" name="mdp"/>
</form>
</td>
</tr>

<tr>
<td align="right">
<label for="mdp2">Confirmer le mot de passe :</label>
</td>

<td>
<input type="password" placeholder="Confirmer votre mot de passe" id="mdp2" name="mdp2"/>
</form>
<?php if(isset($erreur))
{
echo $erreur;
}
?>
</td>
</tr>
<tr>
<td></td>
<td>
<br/>
<input type="submit" name="forminscription" value="Je m'inscris" />
</td>
</table>
</tr>
</div>
</html>
</body>

2 réponses

totoyo47 Messages postés 260 Date d'inscription vendredi 10 juillet 2009 Statut Membre Dernière intervention 30 mars 2020 133
1 déc. 2015 à 23:13
Salut,
Tu n'as pas besoin de répéter If quand tu veux tester plusieurs conditions en même. And suffit.
if(!empty($_POST[pseudo]) and !empty($_POST[mail]) and !empty($_POST[mail2]) and !empty($_POST[mdp]) and !empty($_POST[mdp2]))
0
jai essayer ca ne change rien
0
mais je suis daccord jai quand meme fais une erreur
0
Pitet Messages postés 2826 Date d'inscription lundi 11 février 2013 Statut Membre Dernière intervention 21 juillet 2022 524
2 déc. 2015 à 15:59
Salut,

Il manque un point-virgule en fin de ligne des premiers echo :
echo "Vous étes bien inscrits merci !!";

$erreur = "Tout les champs doivent etre completer!!";


Bonne journée
0