Forum |  HardWare.fr | News | Articles | PC | S'identifier | S'inscrire | Shop Recherche
1414 connectés 

  FORUM HardWare.fr
  Programmation
  PHP

  Problème avec déclaration des variables.

 


 Mot :   Pseudo :  
 
Bas de page
Auteur Sujet :

Problème avec déclaration des variables.

n°1225176
jyms2005
Posté le 18-10-2005 à 10:45:19  profilanswer
 

Bonjour,
 
J'ai déclaré mes variables de cette façon :  
 
$nom = htmlspecialchars(htmlentities($_POST['clinom'], ENT_QUOTES));
$nom = ucfirst($nom);
$prenom = htmlspecialchars(htmlentities($_POST['clipre'], ENT_QUOTES));
$prenom = ucfirst($prenom);
$adresse = htmlspecialchars(htmlentities($_POST['cliadr'], ENT_QUOTES));
$npa = htmlspecialchars(htmlentities($_POST['clinpa'], ENT_QUOTES));
$loc = htmlspecialchars(htmlentities($_POST['cliloc'], ENT_QUOTES));
$tel = htmlspecialchars(htmlentities($_POST['clitel'], ENT_QUOTES));
$mob = htmlspecialchars(htmlentities($_POST['climob'], ENT_QUOTES));
$datenaissance = htmlspecialchars(htmlentities($_POST['clidatenais'], ENT_QUOTES));
$numidentite = htmlspecialchars(htmlentities($_POST['clinumide'], ENT_QUOTES));
$motpasse = htmlspecialchars(htmlentities($_POST['climdp'], ENT_QUOTES));
$cliparraine = htmlspecialchars(htmlentities($_POST['clinum_est_parraine'], ENT_QUOTES));
$clicom = htmlspecialchars(htmlentities($_POST['clicom'], ENT_QUOTES));
 
et quand j'éxécute mon script j'obtient ceci :
 
Notice: Undefined index: clinom in e:\testsphp\ajoutcli.php on line 24
 
Notice: Undefined index: clipre in e:\testsphp\ajoutcli.php on line 26
 
Notice: Undefined index: cliadr in e:\testsphp\ajoutcli.php on line 28
 
Notice: Undefined index: clinpa in e:\testsphp\ajoutcli.php on line 29
 
Notice: Undefined index: cliloc in e:\testsphp\ajoutcli.php on line 30
 
Notice: Undefined index: clitel in e:\testsphp\ajoutcli.php on line 31
 
Notice: Undefined index: climob in e:\testsphp\ajoutcli.php on line 32
 
Notice: Undefined index: clidatenais in e:\testsphp\ajoutcli.php on line 33
 
Notice: Undefined index: clinumide in e:\testsphp\ajoutcli.php on line 34
 
Notice: Undefined index: climdp in e:\testsphp\ajoutcli.php on line 35
 
Notice: Undefined index: clinum_est_parraine in e:\testsphp\ajoutcli.php on line 36
 
Notice: Undefined index: clicom in e:\testsphp\ajoutcli.php on line 37
 
Notice: Undefined index: ajouter in e:\testsphp\ajoutcli.php on line 39

mood
Publicité
Posté le 18-10-2005 à 10:45:19  profilanswer
 

n°1225177
flo850
moi je
Posté le 18-10-2005 à 10:46:29  profilanswer
 

remplace  
 
$nom = htmlspecialchars(htmlentities($_POST['clinom'], ENT_QUOTES));  
 
pas  

Code :
  1. if(isset($_POST['clinom']))
  2.       $nom = htmlspecialchars(htmlentities($_POST['clinom'], ENT_QUOTES));
  3. else
  4.       $nom="";


 
par contre tu devrai te poser la question " piurquoi est ce que mon tableau post ne contient pas les variables voulues ?" et "est ce que c'est grave ?"


Message édité par flo850 le 18-10-2005 à 10:47:11

---------------

n°1225288
jyms2005
Posté le 18-10-2005 à 12:30:36  profilanswer
 

J'ai rajouté ce que tu m'as dis de faire mais il y a un problème encore. C'est avec le bouton ajouter. Au tout début du script je l'ai déclaré commeça
 
if (isset($_POST['ajouter'] == 'ajouter'))
 
mais quand j'éxécute ça fait :
 
Parse error: parse error, expecting `','' or `')'' in e:\testsphp\ajoutcli.php on line 24
 

n°1225291
jyms2005
Posté le 18-10-2005 à 12:34:01  profilanswer
 

Oui c'est bon c'est résolu. Merci


Aller à :
Ajouter une réponse
  FORUM HardWare.fr
  Programmation
  PHP

  Problème avec déclaration des variables.

 

Sujets relatifs
Problème avec switch - case.problème lecture d'une donnée url longue
Probleme avec les expressions regulierespourquoi ça!!! probleme d'initalisation d'options de la balise select
Probleme avec cygwinprobleme avec sql......
probleme pour agrandir la taille d'un DIVProbleme pour aller sur mon site
Probleme generation texte sur imageAide sur les variables($) variables(adj)
Plus de sujets relatifs à : Problème avec déclaration des variables.


Copyright © 1997-2022 Hardware.fr SARL (Signaler un contenu illicite / Données personnelles) / Groupe LDLC / Shop HFR