Parse error sintax

Col -  
jordane45 Messages postés 30426 Date d'inscription   Statut Modérateur Dernière intervention   -
Bonjour, j'ai recopié un tuto sur youtube mais comme je débute dans la programmation je ne sais pas quel est l'erreur.

<!DOCTYPE html>
<html>
<head>
<title>Titre</title>
</head>
<body>
<?php include 'navigation.php'; ?>

<form method="post">
<input type="text" name="Nom" id="pseudo" placeholder="Votre Nom" required><br/>
<input type="text" name="Prénom" id="pseudo" placeholder="Votre Prénom" required><br/>
<input type="text" name="Email" id="pseudo" placeholder="Votre Email" required><br/>
<input type="submit" name="formsend" id="formsend">
</form>

<?php
if (isset($_POST[formsend]))
{
$Nom = $_POST['Nom'];
$Prénom = $_POST['Prénom'];
$Email = $_POST['Email'];

if (!empty($Nom) && !empty($Prénom) && !empty($Email)) {
echo "Votre Nom : ".$Nom . "<br/>";
echo "Votre Prénom : ".$Prénom . "<br/>";
echo "Votre Email : ".$Email . "<br/>";
}

}

</body>
</html>

2 réponses

  1. jordane45 Messages postés 30426 Date d'inscription   Statut Modérateur Dernière intervention   4 830
     
    Bonjour,

    Ne jamais utiliser de caractères accentués dans le nom des variables.

    <?php
    //Affichage des erreurs PHP
    error_reporting(E_ALL);
    ini_set('display_errors', TRUE);
    ini_set('display_startup_errors', TRUE);
    
    //récupération propre des variables avant de les utiliser
    $Nom = !empty($_POST['Nom']) ? $_POST['Nom'] : NULL;
    $Email = !empty($_POST['Email']) ? $_POST['Email'] : NULL;
    $Prenom = !empty($_POST['Prenom']) ? $_POST['Prenom'] : NULL;
    
    ?>
    <!DOCTYPE html>
    <html>
        <head>
          <title>UNAGIOTAGE</title>
          <meta charset='utf-8'>
        </head> 
        <body>
          <?php include 'navigation.php'; ?>
    
          <form method="post "action="">
            <input type="text" name="Nom" id="pseudo" placeholder="Votre Nom" required><br/>
            <input type="text" name="Prenom" id="pseudo" placeholder="Votre Prénom" required><br/>
            <input type="text" name="Email" id="email" placeholder="Votre Email" required><br/>
            <input type="submit" name="formsend" id="formsend">
          </form>
          <?php
          if ($Nom  &&  $Prenom && $Email ) {
            echo "Votre Nom : ".$Nom . "<br/>";
            echo "Votre Prénom : ".$Prenom . "<br/>";
            echo "Votre Email : ".$Email . "<br/>";
          }
          ?>
      </body>
    </html>
    


    Au passage, voici quelques conseils pour l'écriture de tes futurs codes
    https://forums.commentcamarche.net/forum/affich-37584947-php-gestion-des-erreurs-debogage-et-ecriture-du-code

    .
    0