Problème d'inscription (php)
Résolu
nicolas505
Messages postés
11
Date d'inscription
Statut
Membre
Dernière intervention
-
magicshark Messages postés 402 Date d'inscription Statut Membre Dernière intervention -
magicshark Messages postés 402 Date d'inscription Statut Membre Dernière intervention -
Bonjour, j'essaie de faire une inscription pour mon site mais je tombe sur un syntax error voici le code du formulaire inscription.php:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" >
<head>
<title>UseTool - Inscription</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<style>
html{
background: url("UseTool_background.png") no-repeat;
}
body{
width: 600px;
height: 300px;
margin-left: 280px;
margin-top: 250px;
border: 2px solid dodgerblue;
background-color: aliceblue;
padding-top: 90px;
border-radius: 5px;
}
label ,#inscrire{
padding: 20px;
}
label, input{
margin: 10px;
}
</style>
</head>
<body><center>
<form method="post" action="redirection.php">
<label for="mail"> Adresse mail </label>:<input type="text" name="mail"/><br/>
<label for="mot_de_passe"> Mot de passe </label>:<input type="password" name="mot_de_passe"/><br/>
<label for="mot_de_passe_confirm"> Confirmez votre mot de passe </label>:<input type="password" name="mot_de_passe_confirm" /><br/>
</a><br/>
<input type="submit" value="M'inscrire" id="inscrire"/>
</form></center>
</body>
</html>
qui envoie les saisies sur la page redirection.php qui traite le tout, voici le code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" >
<head>
<title>Redirection</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body>
<?php
if(!empty($_POST['mail'])){
$mail= $_POST['mail'];
$mail_verif= 1;
}
else{
$mail_verif= 0;
}
if(!(empty($_POST['mot_de_passe'])) AND !(empty($_POST['mot_de_passe_confirm'])) AND $_POST['mot_de_passe']==$_POST['mot_de_passe_confirm']){
$mot_de_passe= $_POST['mot_de_passe'];
$mot_de_passe_verif= 1;
}
else{
$mot_de_passe_verif= 0;
}
if(mail_verif==1 AND $mot_de_passe_verif==1){
echo "Votre adresse mail :";
echo $mail;
echo "<br/>";
echo "Votre mot de passe :";
echo $mot_de_passe;
echo "<br/>";
echo "Condition cochee";
?>
</body>
</html>
et voici l'erreur: "Parse error: syntax error, unexpected $end in /homepages/40/d333019527/htdocs/redirection.php on line 36"
La ligne 36 représente la fermeture de la balise "html" (</html>)
C'est normal si le code n'est pas relié à la BDD ,ceci était un test .... qui n'a pas marché.
Merci d'avance.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" >
<head>
<title>UseTool - Inscription</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<style>
html{
background: url("UseTool_background.png") no-repeat;
}
body{
width: 600px;
height: 300px;
margin-left: 280px;
margin-top: 250px;
border: 2px solid dodgerblue;
background-color: aliceblue;
padding-top: 90px;
border-radius: 5px;
}
label ,#inscrire{
padding: 20px;
}
label, input{
margin: 10px;
}
</style>
</head>
<body><center>
<form method="post" action="redirection.php">
<label for="mail"> Adresse mail </label>:<input type="text" name="mail"/><br/>
<label for="mot_de_passe"> Mot de passe </label>:<input type="password" name="mot_de_passe"/><br/>
<label for="mot_de_passe_confirm"> Confirmez votre mot de passe </label>:<input type="password" name="mot_de_passe_confirm" /><br/>
</a><br/>
<input type="submit" value="M'inscrire" id="inscrire"/>
</form></center>
</body>
</html>
qui envoie les saisies sur la page redirection.php qui traite le tout, voici le code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" >
<head>
<title>Redirection</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
</head>
<body>
<?php
if(!empty($_POST['mail'])){
$mail= $_POST['mail'];
$mail_verif= 1;
}
else{
$mail_verif= 0;
}
if(!(empty($_POST['mot_de_passe'])) AND !(empty($_POST['mot_de_passe_confirm'])) AND $_POST['mot_de_passe']==$_POST['mot_de_passe_confirm']){
$mot_de_passe= $_POST['mot_de_passe'];
$mot_de_passe_verif= 1;
}
else{
$mot_de_passe_verif= 0;
}
if(mail_verif==1 AND $mot_de_passe_verif==1){
echo "Votre adresse mail :";
echo $mail;
echo "<br/>";
echo "Votre mot de passe :";
echo $mot_de_passe;
echo "<br/>";
echo "Condition cochee";
?>
</body>
</html>
et voici l'erreur: "Parse error: syntax error, unexpected $end in /homepages/40/d333019527/htdocs/redirection.php on line 36"
La ligne 36 représente la fermeture de la balise "html" (</html>)
C'est normal si le code n'est pas relié à la BDD ,ceci était un test .... qui n'a pas marché.
Merci d'avance.
A voir également:
- Problème d'inscription (php)
- Wetransfer gratuit sans inscription - Guide
- Twitter inscription - Guide
- Vinted inscription - Guide
- Paypal inscription - Guide
- Instagram inscription - Guide
3 réponses
il faut fermer le dernier IF
if(mail_verif==1 AND $mot_de_passe_verif==1){
echo "Votre adresse mail :";
echo $mail;
echo "<br/>";
echo "Votre mot de passe :";
echo $mot_de_passe;
echo "<br/>";
echo "Condition cochee";
/*
/////////////////////////////////////////////
///////////////// ///////////////////
///////////////// ICI ///////////////////
///////////////// ///////////////////
/////////////////////////////////////////////
*/
}
?>
if(mail_verif==1 AND $mot_de_passe_verif==1){
echo "Votre adresse mail :";
echo $mail;
echo "<br/>";
echo "Votre mot de passe :";
echo $mot_de_passe;
echo "<br/>";
echo "Condition cochee";
/*
/////////////////////////////////////////////
///////////////// ///////////////////
///////////////// ICI ///////////////////
///////////////// ///////////////////
/////////////////////////////////////////////
*/
}
?>