salut à tous je suis débutant en PHP . je suis entreint de concevoir un code PHP et voila que je suis bloqué. alors je suis la pour solliciter votre aide .
voici l'erreur que je reçois :
Notice: Undefined index: autrepiece in C:\wamp\www\IDENTIFICATION\ESSAI fiche d'identification ministere ex-Combattants.php on line 20

Notice: Undefined index: nomRegion in C:\wamp\www\IDENTIFICATION\ESSAI fiche d'identification ministere ex-Combattants.php on line 27

Notice: Undefined index: nomDepartement in C:\wamp\www\IDENTIFICATION\ESSAI fiche d'identification ministere ex-Combattants.php on line 28

Notice: Undefined index: vaccinBCG in C:\wamp\www\IDENTIFICATION\ESSAI fiche d'identification ministere ex-Combattants.php on line 39

Notice: Undefined index: vaccinPOLIO in C:\wamp\www\IDENTIFICATION\ESSAI fiche d'identification ministere ex-Combattants.php on line 40

Notice: Undefined index: vaccinFIEVRE in C:\wamp\www\IDENTIFICATION\ESSAI fiche d'identification ministere ex-Combattants.php on line 41

Notice: Undefined index: vaccinROUGEOLE in C:\wamp\www\IDENTIFICATION\ESSAI fiche d'identification ministere ex-Combattants.php on line 42

Notice: Undefined variable: result in C:\wamp\www\IDENTIFICATION\ESSAI fiche d'identification ministere ex-Combattants.php on line 71
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<?php
$date = date("d-m-Y");
$heure = date("H:i");
echo 'Nous sommes le '.$date.' et il est '.$heure;
?>
<?php
if (isset($_POST["valider"])) {
    $matricule=trim($_POST["matricule"]);
    $nom=trim($_POST["nom"]);
	$prenom=trim($_POST["prenom"]);
	$datnaiss=trim($_POST["datnaiss"]);
	$lieunaiss=trim($_POST["lieunaiss"]);
	$nationalite=trim($_POST["nationalite"]);
	$ethnie=trim($_POST["ethnie"]);
	$sexe=trim($_POST["sexe"]);
	$situation=trim($_POST["situation"]);
	$religion=trim($_POST["religion"]);
	$piece=trim($_POST["piece"]);
	$npiece=trim($_POST["npiece"]);
	$autrepiece=trim($_POST["autrepiece"]);
	$nompere=trim($_POST["nompere"]);
	$prenompere=trim($_POST["prenompere"]);
	$nommere=trim($_POST["nommere"]);
	$prenommere=trim($_POST["prenommere"]);
	$tel=trim($_POST["tel"]);
	$cel=trim($_POST["cel"]);
	$nomRegion=trim($_POST["nomRegion"]);
	$nomDepartement=trim($_POST["nomDepartement"]);
	$nomSousprefecture=trim($_POST["nomSousprefecture"]);
	$nomVillage=trim($_POST["nomVillage"]);
	$nomZone=trim($_POST["nomZone"]);
	$nomEmployeur=trim($_POST["nomEmployeur"]);
	$prenomEmployeur=trim($_POST["prenomEmployeur"]);
	$prenomConjoint=trim($_POST["nomConjoint"]);
	$nomEnfant=trim($_POST["nomEnfant"]);
	$prenomEnfant=trim($_POST["prenomEnfant"]);
	$nomAgent=trim($_POST["nomAgent"]);
	$prenomAgent=trim($_POST["prenomAgent"]);
	$vaccinBCG=trim($_POST["vaccinBCG"]);
	$vaccinPOLIO=trim($_POST["vaccinPOLIO"]);
	$vaccinFIEVRE=trim($_POST["vaccinFIEVRE"]);
	$vaccinROUGEOLE=trim($_POST["vaccinROUGEOLE"]);
	$type=trim($_POST["type"]);
	$nomZone=trim($_POST["nomZone"]);
	$nomTuteur=trim($_POST["nomTuteur"]);
 
	if (empty($matricule) || empty($nom)|| empty($prenom)) {
		$msg="<font color=red>Veuillez saisir votre matricule et votre nom et prenom !!!!!!!!!</font>";
 
			mysql_connect("localhost","root","") or die("erreur de connexion");
			mysql_select_db("la_base_du_ministere") or die("Erreur de selection de la BD");
			// on insert les données
 
			$sql1="INSERT INTO eleve(matricule,nom,prenom,datnaiss,lieunaiss,nationalite,ethnie,sexe,situation,religion,piece,npiece,autrepiece,nompere,prenompere,nommere,prenommere,tel,cel) 
values('".$matricule."','".$nom."','".$prenom."','".$datnaiss."','".$lieunaiss."','".$nationalite."','".$ethnie."','".$sexe."','".$situation."','".$religion."','".$piece."','".$npiece."','".$autrepiece."','".$nompere."','".$prenompere."','".$nommere."','".$prenommere."','".$tel."','".$cel."')";
$sql2="INSERT INTO region(nomRegion) values('".$nomRegion."')";
$sql3="INSERT INTO departemnt(nomDepartement) values('".$nomDepartement."')";
$sql4="INSERT INTO sousprefecture(nomSousprefecture) values('".$nomSousprefecture."')";
$sql5="INSERT INTO village(nomVillage) values('".$nomVillage."')";
$sql6="INSERT INTO zone(nomZone) values('".$nomZone."')";
$sql7="INSERT INTO employeur(nomEmployeur,prenomEmployeur) values('".$nomEmployeur."','".$prenomEmployeur."')";
$sql8="INSERT INTO conjont(nomConjoint,prenomConjoint) values('".$nomConjoint."','".$prenomConjoint."')";
$sql9="INSERT INTO enfant(nomEnfant,prenomEnfant) values('".$nomEnfant."','".$prenomEnfant."')";
$sql10="INSERT INTO agent(nomAgent,prenomAgent) values('".$nomAgent."','".$prenomAgent."')";
$sql11="INSERT INTO vaccin(vaccinBCG,vaccinPOLIO,vaccinFIEVRE,vaccinROUGEOLE) values('".$vaccinBCG."','".$vaccinPOLIO."','".$vaccinFIEVRE."','".$vaccinROUGEOLE."')";
$sql12="INSERT INTO activite(type) values('".$type."')";
$sql13="INSERT INTO zone(nomZone) values('".$nomZone."')";
$sql14="INSERT INTO tuteur(nomTuteur,prenomTuteur) values('".$nomTuteur."','".$prenomTuteur."')";
 
			$result=mysql_query($sql1,$sql2,$sql3,$sql4,$sql5,$sql6,$sql7,$sql8,$sq99,$sql10,$sql11,$sql12,$sql13,$sql14);  }
		if ($result) {
			$msg="<font color=green>insertion OK</font>";
		}
		else {
			$msg="<font color=red>insertion impossible</font>";
		}
 
 
}
 
?>