IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Langage PHP Discussion :

Notice: Undefined variable: variable


Sujet :

Langage PHP

  1. #1
    Membre du Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Mars 2012
    Messages
    66
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Mars 2012
    Messages : 66
    Points : 49
    Points
    49
    Par défaut Notice: Undefined variable: variable
    bonjour,

    je fait un formulaire sur ma page d'inscription. et je voudrais tester le mot de passe et le mail grâce à des champs "confirmation mot de passe et mail".

    J'ai fait un if pour faire ce test mais il me met "Notice: Undefined variable: pass2", "Notice: Undefined variable: pass", "Notice: Undefined variable: mail2" et "Notice: Undefined variable: mail"

    voici le code
    [CODE]
    <?php

    if (isset($_post['nom'])) {

    $nom = $_post['nom'];
    $prenom = $_post['prenom'];
    $pseudo = $_post['pseudo'];
    $pass = $_post['pass'];
    $pass2 = $_post['pass2'];
    $mail = $_post['mail'];
    $mail2 = $_post['mail2'];


    }
    if ($pass != $pass2 OR $mail != $mail2){

    echo 'Les "<strong>mots de passe </strong>" ou "<strong>mails</strong>" ne sont pas identiques';

    }

    ?>

    <h1> Inscription </h1> <br/>

    <div id="central">

    <form method="POST" action="inscription.php">
    <table>
    <tr>
    <td><label for="nom"> <span class="idform"> Nom: </span> </label></td> <td><input type="text" name="nom" id="nom"></td>
    </tr>
    <tr>
    <td><label for="prenom"> <span class="idform"> Prenom: </span> </label></td> <td><input type="text" name="prenom" id="prenom"></td>
    </tr>
    <tr>
    <td><label for="pseudo"> <span class="idform"> Pseudo*: </span></label></td> <td><input type="text" name="pseudo" id="pseudo"></td>
    </tr>
    <tr>
    <td><label for="pass"> <span class="idform"> Mot de passe*: </span></label></td> <td><input type="password" name="pass" id="pass"/></td>
    </tr>
    <tr>
    <td><label for="pass2"> <span class="idform"> Confirmation mot de passe*: </span></label></td> <td><input type="password" name="pass2" id="pass2"/></td>
    </tr>
    <tr>
    <td><label for="mail"> <span class="idform"> Mail*: </span></label></td> <td><input type="text" name="mail" id="mail"></td>
    </tr>
    <tr>


    merci d'avance

  2. #2
    Membre actif
    Profil pro
    Inscrit en
    Février 2009
    Messages
    149
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2009
    Messages : 149
    Points : 206
    Points
    206
    Par défaut
    Bin c'est que tu as des variable pas définis.

  3. #3
    Membre du Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Mars 2012
    Messages
    66
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Mars 2012
    Messages : 66
    Points : 49
    Points
    49
    Par défaut
    pourtant $pass, $pass2, $mail et $mail2 sont bien déclaréees.

  4. #4
    Membre actif
    Profil pro
    Inscrit en
    Février 2009
    Messages
    149
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2009
    Messages : 149
    Points : 206
    Points
    206
    Par défaut
    $_POST['pass'];

  5. #5
    Membre du Club
    Homme Profil pro
    Étudiant
    Inscrit en
    Mars 2012
    Messages
    66
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Étudiant
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Mars 2012
    Messages : 66
    Points : 49
    Points
    49
    Par défaut
    nickel !
    effectivement le"post" doit être en majuscule "$POST"

    merci bcp

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Notice: Undefined index & Variable
    Par MTHYC dans le forum Langage
    Réponses: 3
    Dernier message: 05/03/2012, 08h01
  2. Notice: Undefined variable: id in
    Par dynam dans le forum SQL Procédural
    Réponses: 1
    Dernier message: 11/09/2007, 17h12
  3. Notice: Undefined variable
    Par oranoutan dans le forum Langage
    Réponses: 19
    Dernier message: 21/12/2005, 22h28
  4. Notice: Undefined variable
    Par kayn dans le forum Langage
    Réponses: 2
    Dernier message: 03/10/2005, 20h44
  5. Réponses: 3
    Dernier message: 22/09/2005, 11h24

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo