mardi 17 novembre 2020

Why is this "}" unexpected by the code while other "else" blocks have "}" at the end and don't care? (PHP) [closed]

I'm facing some strange errors and I can't fix it. I looked up several SO questions that got some answers, but that didn't help me. There's an unexpected "}" at the end of line 16, but echos above also have an "}" at the end, and it causes no error. Why? Anyway, here's the code (don't mind the french words here and there):

<?php
            $prenom = $_POST['prenom'];
            $nom = $_POST['nom'];
            print ("<center>Bonjour $prenom $nom</center>");
            $adresse = $_POST['adresse'];
            if (empty($adresse)) {
                $vide = $vide+1;}   
            else {
                echo("Votre adresse est: '<b>$adresse</b>'" }
            $email = $_POST['mail'];
            $point = strpos($email,".");
            $aroba = strpos($email,"@");
            if($point=='') {
                echo "Votre email doit comporter un <b>point</b>"; }
            elseif ($aroba=='') {
                echo "Votre email doit comporter un <b>'@'</b>"; }
            else {
                echo "Votre email est: '<a href=\"mailto:"."$email"."\"><b>$email</b></a>'";
            }
            if(count($tel)<>10) {
            echo "Votre numéro de téléphone doit être composé de <b>10</b> chiffres. Vérifiez bien la longueur de votre numéro !"; }
            else {
                echo "Votre numéro de téléphone est '<b>$tel</b>'";
            }
            if (empty($nom)) {
                $vide = $vide+1 }
            if (empty($prenom)) {
                $vide = $vide+1 }
            if (empty($email)) {
                $vide = $vide+1 }
            if (empty($tel)) {
                $vide = $vide+1 }
            if ($vide>0) {
                echo "Il y a '<b>$vide</b>' champs vides !"
        ?>

Aucun commentaire:

Enregistrer un commentaire