salut à tous,
je suis en train de réaliser un formulaire en php ,mon formulaire est relié à une Base de données. Mon problème, quand je rempli le formulaire,les enregistrements ne sont pas pris en compte dans la base de donnée. si quelqu'un pouvait me donner un coup de main. voici mes différents formulaires
fichesaisie.php
<form action="serv_fichesaisie.php" method="post">
<table width="835" border="0">
<td width="673" align="center">
<table border="1" align="center" bgcolor="#CCCCCC" class="dTable">
<thead>
<td colspan="5"><div align="center"><strong>SAISIE DES NOTES DE L'ELEVE</strong></div></td>
<tr>
<th>Matieres Spécifiques</th>
<th>1er Trimestre </th>
<th>2ème Trimestre</th>
<th>3ème Trimestree</th>
<th>Moyenne Anuelle</th>
</tr>
<tr>
<td><input name="matiere[]" type="texte" disabled="disabled" value="FRANCAIS" /></td>
<td><input type="text" id="ch1" name="notfranc1" /></td>
<td><input type="text" id="ch2" name="notfranc2" /></td>
<td><input type="text" id="ch3" name="notfranc3" /></td>
<td><input type="text" id="ch4" name="notfranc4" /></td>
</tr>
<tr>
<td><input name="matiere[]" type="texte" disabled="disabled" value="MATHEMATIQUES" /></td>
<td><input type="text" id="ch1" name="notmath1" /></td>
<td><input type="text" id="ch2" name="notmath2" /></td>
<td><input type="text" id="ch3" name="notmath3" /></td>
<td><input type="text" id="ch4" name="notmath4" /></td>
</tr>
<tr>
<td><input name="matiere[]" type="texte" disabled="disabled" value="ANGLAIS" /></td>
<td><input type="text" id="ch1" name="notanglais1" /></td>
<td><input type="text" id="ch2" name="notanglais2" /></td>
<td><input type="text" id="ch3" name="notanglais3" /></td>
<td><input type="text" id="ch4" name="notanglais4" /></td>
</tr>
<tr>
<td><input name="matiere[]" type="texte" disabled="disabled" value="SCIENCES PHYSIQUES" /></td>
<td><input type="text" id="ch1" name="notphys1" /></td>
<td><input type="text" id="ch2" name="notphys2" /></td>
<td><input type="text" id="ch3" name="notphys3" /></td>
<td><input type="text" id="ch4" name="notphys4" /></td>
</tr>
<tr>
<td><input name="matiere[]" type="texte" disabled="disabled" value="ORTHOGRAPHE" /></td>
<td><input type="text" id="ch1" name="notortho1" /></td>
<td><input type="text" id="ch2" name="notortho2" /></td>
<td><input type="text" id="ch3" name="notortho3" /></td>
<td><input type="text" id="ch4" name="notortho4" /></td>
</tr>
<tr>
<td><input name="matiere[]" type="texte" disabled="disabled" value="HISTOIRE GEOGRAPHIE" /></td>
<td><input type="text" id="ch1" name="histgeo1" /></td>
<td><input type="text" id="ch2" name="histgeo2" /></td>
<td><input type="text" id="ch3" name="histgeo3" /></td>
<td><input type="text" id="ch4" name="histgeo4" /></td>
</tr>
<tr>
<td><input name="matiere[]" type="texte" disabled="disabled" value="SVT" /></td>
<td><input type="text" id="ch1" name="notsvt1" /></td>
<td><input type="text" id="ch2" name="notsvt2" /></td>
<td><input type="text" id="ch3" name="notsvt3" /></td>
<td><input type="text" id="ch4" name="notsvt4" /></td><br />
</tr>
<tr><td colspan="5" bgcolor="#CCCCCC"><div align="center"><strong>AUTRES INFORMATION</strong></div></td>
<tr>
<td width="116"> Résultat
<select name="ResultatExamenCand" id="SexeCand">
<option value="admis">Admis(e)</option>
<option value="refus">refusé</option>
</select> <td colspan="2">Sélectionnez un élément. Handicap
</td>
<td width="144">Métier
<input name="metier" type="texte" /></td>
<td width="153" colspan="2">Sélectionnez un élément. Handicap<input name="HandicapCand" type="texte" /></td>
</tr>
<tr>
<td height="72">double selection
<select name="DoubleSelectCand" id="DoubleSelectCand">
<option value="technique">technique</option>
<option value="refus">general</option>
</select> </td>
<td width="144">Résidence des parent
<input type="text" name="residenceParentCand" /></td>
<td width="160">Personne prise en charge
<select name="PersoneEnChargeCand" id="PersoneEnChargeCand">
<option value="parent">Parent</option>
<option value="tuteur">Tuteur</option>
</select> </td>
<td width="144">Contact
<input type="text" name="CelCand" /></td>
</tr>
</table>
<p align="center"> </p>
<table border="1" bgcolor="#CCCCCC" align="center">
<tr><td colspan="3"> <p align="center"><strong>VOEUX D'ORIENTATION DE L'ELEVE </strong></p></td></tr>
<tr>
<td width="231">FILIERES(Entrée le code de la filière)</td>
<td colspan="2"><p align="center">ETABLISSEMENTS (Entrée le code de l'établissement)</p>
<p> </p></td>
</tr>
<tr>
<td rowspan="5"><input type="text" name="filieres" /></td>
<td width="100" height="">
<p><input type="text" name="filiere1" /></p>
</td>
<td width="273">1er Etablissement</td>
</tr>
<tr>
<td><input type="text" name="filiere2" /></td>
<td>2ème Etablissement</td>
</tr>
<tr>
<td height="21"><input type="text" name="filiere3" /></td>
<td height="21">2ème Etablissement</td>
</tr>
</table>
<tr><td><div align="center">
<input type="submit" name="validation" value="valider" /></div></td>
</tr>
</form>
voici le formulaire serveur
serv_fichesaisie.php
<?php session_start(); require_once('connexion.php'); ?>
<?php
mysql_select_db($database_dbprotect, $dbprotect);
if ((isset($_POST['validation'])) && $_POST['validation'] == "valider") {
echo "<pre>";
print_r($_POST);
echo "</pre>";
extract($_POST);
//$francais=addslashes($_POST["francais"]);
$notfranc1 = addslashes($_POST["notfranc1"]);
$notfranc2 = addslashes($_POST["notfranc2"]);
$notfranc3 = addslashes($_POST["notfranc3"]);
$notfranc4 = addslashes($_POST["notfranc4"]);
//$math=addslashes($_POST["math"]);
$notmath1 = addslashes($_POST["notmath1"]);
$notmath2 = addslashes($_POST["notmath2"]);
$notmath3 = addslashes($_POST["notmath3"]);
$notmath4 = addslashes($_POST["notmath4"]);
//$anglais=addslashes($_POST["anglais"]);
$notanglais1 = addslashes($_POST["notanglais1"]);
$notanglais2 = addslashes($_POST["notanglais2"]);
$notanglais3 = addslashes($_POST["notanglais3"]);
$notanglais4 = addslashes($_POST["notanglais4"]);
//$scphys=addslashes($_POST["scphys"]);
$notphys1 = addslashes($_POST["notphys1"]);
$notphys2 = addslashes($_POST["notphys2"]);
$notphys3 = addslashes($_POST["notphys3"]);
$notphys4 = addslashes($_POST["notphys4"]);
//$ortho=addslashes($_POST["ortho"]);
$notortho1 = addslashes($_POST["notortho1"]);
$notortho2 = addslashes($_POST["notortho2"]);
$notortho3 = addslashes($_POST["notortho3"]);
$notortho4 = addslashes($_POST["notortho4"]);
//$histgeo=addslashes($_POST["histgeo"]);
$histgeo1 = addslashes($_POST["histgeo1"]);
$histgeo2 = addslashes($_POST["histgeo2"]);
$histgeo3 = addslashes($_POST["histgeo3"]);
$histgeo4 = addslashes($_POST["histgeo4"]);
//$svt=addslashes($_POST["svt"]);
$notsvt1 = addslashes($_POST["notsvt1"]);
$notsvt2 = addslashes($_POST["notsvt2"]);
$notsvt3 = addslashes($_POST["notsvt3"]);
$notsvt4 = addslashes($_POST["notsvt4"]);
$ResultatExamenCand = addslashes($_POST["ResultatExamenCand"]);
$metier = addslashes($_POST["metier"]);
$HandicapCand = addslashes($_POST["HandicapCand"]);
$DoubleSelectCand = addslashes($_POST["DoubleSelectCand"]);
$residenceParentCand = addslashes($_POST["residenceParentCand"]);
$PersoneEnChargeCand = addslashes($_POST["PersoneEnChargeCand"]);
$CelCand = addslashes($_POST["CelCand"]);
$validation = array();
for($u=0;$u < $count($matiere);$u++)
{
$matiere = $matiere[$u];
$requete = "INSERT INTO note (trimestre1 , trimestre2, trimestre3,moyenannuel)VALUES ('',";
switch ($matiere) {
case "FRANCAIS":
$parametres = $notfranc1."', '".$notfranc2."', '".$notfranc3."', '".$notfranc4."'";
break;
case "MATHEMATIQUES":
$parametres = $notmath1."', '".$notmath2."', '".$notmath3."', '".$notmath4."'";
break;
case "ANGLAIS":
$parametres = $notanglais1."', '".$notanglais2."', '".$notanglais3."', '".$notanglais4."'";
break;
case "SCIENCES PHYSIQUES":
$parametres = $notphys1."', '".$notphys2."', '".$notphys3."', '".$notphys4."'";
break;
case "ORTHOGRAPHE":
$parametres = $notortho1."', '".$notortho2."', '".$notortho3."', '".$notortho4."'";
break;
case "HISTOIRE GEOGRAPHIE":
$parametres = $histgeo1."', '".$histgeo2."', '".$histgeo3."', '".$histgeo4."'";
break;
case "SVT":
$parametres = $notsvt1."', '".$notsvt2."', '".$notsvt3."', '".$notsvt4."'";
break;
}
$tableau[1] = $requete .= $parametres.'")";';
$tableau[2] = $requete_info = "INSERT INTO candidat (ResultatExamenCand ,metier, Handicap,DoubleSelectCand,residenceParentCand,PersoneEnChargeCand,CelCand )VALUES ('', '$ResultatExamenCand', '$metier', '$Handicap', '$DoubleSelectCand','$residenceParentCand','$PersoneEnChargeCand','$CelCand')";
function validiter_execution($requete_a_executer)
{
return (mysql_query($requete_a_executer)) ? true : false;
}
$statut_execution_requete = "";
for($i=0;$i< count($tableau);$i++)
{
$statut_execution_requete = validiter_execution($tableau[$i]);
}
$validation[$u] = $statut_execution_requete;
}
// if (in_array(false, $validation)) // validation a tester
//
// {
// echo "<h3>l'inscription a ´chou´e</h3>";
// }
// else
// {
// echo "<h3>l'inscription a été effectuée avec succès</h3>";
// }
echo "<h3>l'inscription a été effectuée avec succès</h3>";
echo "<a href=\"Inscription.html\">Nouvelle inscription</a>";
echo "<br><a href=\"Consultation.php\">Consulter la liste</a>";
}
?>