-1

I have a problem for a connection page i'm trying to set up, after the connection form, the conditionnal block of code that should verify the info just appear instead of executing. Everything appear after , even the semi-colon and parenthesis that should end the if. What did I do wrong?

<?php
// if ($id!=0)  {erreur(ERR_IS_CO)};
if (!isset($_POST['mail'])) 
    { 
      echo "<form method="post" action="connexion.php">
        <fieldset>
        <legend>Connexion</legend>
            <p>
            <label for="mail">Mail :</label><input name="mail" type="text" id="mail" /><br />
            <label for="password">Mot de Passe :</label><input type="password" name="password" id="password" />
            </p>
        </fieldset>
        <p><input type="submit" value="Connexion" /></p></form>" ;
    }
else
{
        $message;
        if (empty($_POST['mail']) || empty($_POST['password']) )  //empty space
        {
            $message = "<p>une erreur s\'est produite pendant votre identification. Vous devez remplir tous les champs</p>
            <p>Cliquez <a href="./connexion.php">ici</a> pour revenir</p>";
        }
        else //password checker
        {  
            if ( md5($_POST['password']) == 'student')  // Student
            { 
                $_SESSION['mail'] = $_POST['mail'];
                $_SESSION['id'] = "student";
                $message = "<p>Bienvenue student 
                vous êtes maintenant connecté!</p>" //.$data['Nom']., need to fetch name
                <p>Cliquez <a href="./index.php">ici</a> pour revenir à la page d accueil</p>;  
            }
            else // Access denied
            { 
                $message = "<p>Une erreur s\est produite pendant votre identification.<br /> Le mot de passe ou le pseudo 
                entré n\est pas correct.</p><p>Cliquez <a href="./ProjetPHP_Page Connection.html">ici</a> 
                pour revenir à la page précédente <br />";
            }   
                $query->CloseCursor();
        }   
        echo $message;
}
?>
Sverri M. Olsen
  • 13,055
  • 3
  • 36
  • 52

1 Answers1

0

Syntax error is reason of showing blank page, use Netbeans or Sublime software helps you and you need concatination or use single quotes inside double quotes

Example

   echo "<form method='post' action='connexion.php'>

and also enable your errors to see reason of blank page

Maninderpreet Singh
  • 2,569
  • 2
  • 17
  • 31