Bonjour,
mon probleme c'est que ma page de mise a jour fonctionnait correctement , mais apres avoir faire quelque modification sur l'interface et le code php le mise ajour est devenu impossible malgré qu'il n y a aucune erreur syntaxique .
voila l'interface:
<?php
session_start();
if (isset($_POST['creer2'])){
if ((isset($_SESSION['login'])) && (isset ($_SESSION['pass']))){
$base = mysql_connect ('localhost','root','');
$bd= mysql_select_db ('cvtheque');
$sql_1="select * from info_formation_stage where matricule='".$_POST['mat']."'";
$res_1=mysql_query($sql_1)or die('Erreur SQL !'.$sql_1.'<br />'.mysql_error());
while($li=mysql_fetch_array($res_1))
{$a=$li[1];$b=$li[4];}
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="description" content="Place your description here" />
<meta name="keywords" content="put, your, keyword, here" />
<meta name="author" content="Templates.com - website templates provider" />
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body id="page3">
<!-- header -->
<div id="header">
<div class="container">
<div class="logo"><img src="images/cvtheque.PNG" width="258" height="102" alt="" longdesc="images/cvtheque.PNG" /></div>
</div>
<ul class="site-nav">
<li><a href="accueil.php" class="m1">accueil</a></li>
<li><a href="about-us.html" class="m2">cvtheque</a></li>
<li><a href="services.html" class="m3">services</a></li>
<li><a href="support.html" class="m4">administrer</a></li>
<li><a href="sitemap.html" class="m6">rechercher</a></li>
</ul>
</div>
</div>
<!-- content -->
<div id="content">
<div class="container">
<div class="wrapper">
<div class="aside">
<div class="indent">
<div class="link">
<p><a href="deconnection.php">deconncetion</a></p>
<p><a href="ajouter_formation_stage.html">retourner a la page precedente </a></p>
<p><a href="supprimer_formation_stage.html">Supprimer les informations de formation et stage </a></p></div>
</div>
</div>
<div class="content">
<h2>Taper la matricule dont vous voulez modifier les inforamations de formation et stage </h2>
<form action="modifier_formation_stage.php" method="post" name="f1">
<table width="493" border="0">
<tr>
<td><label for="mat">Matricule <br />
<br />
</label></td>
<td><input name="mat" type="text" size="30" maxlength="20" /></td>
</tr>
</table>
<p><center>
<input name="creer2" type="submit" value="envoyer" />
<input name="input2" type="button" value="annuller" />
</center></p>
</form>
<h2> </h2>
<h2>modifier les inforamations de formation et stage </h2>
<form action="modifier_formation_stage1.php" method="post" name="ajouter_exp">
<table width="493" border="0">
<tr>
<td><label for="stage">stage<br />
<br />
</label></td>
<td><textarea name="stage" cols="60" rows="8"><?php if (isset($_POST['creer2'])) echo $a ?></textarea></td>
</tr>
<tr>
<td valign="top">date_debut_stage</td>
<td>jour
<select name="jour" id="jour">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
<option value="13">13</option>
<option value="14">14</option>
<option value="15">15</option>
<option value="16">16</option>
<option value="17">17</option>
<option value="18">18</option>
<option value="19">19</option>
<option value="20">20</option>
<option value="21">21</option>
<option value="22">22</option>
<option value="23">23</option>
<option value="24">24</option>
<option value="25">25</option>
<option value="26">26</option>
<option value="27">27</option>
<option value="28">28</option>
<option value="29">29</option>
<option value="30">30</option>
<option value="31">31</option>
</select>
mois
<select name="mois" id="mois">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
</select>
année
<select name="an" id="an">
<option value="1970">1970</option>
<option value="1971">1971</option>
<option value="1972">1972</option>
<option value="1973">1973</option>
<option value="1974">1974</option>
<option value="1975">1975</option>
<option value="1976">1976</option>
<option value="1977">1977</option>
<option value="1978">1978</option>
<option value="1979">1979</option>
<option value="1980">1980</option>
<option value="1981">1981</option>
<option value="1982">1982</option>
<option value="1983">1983</option>
<option value="1984">1984</option>
<option value="1985">1985</option>
<option value="1986">1986</option>
<option value="1987">1987</option>
<option value="1988">1988</option>
<option value="1989">1989</option>
<option value="1990">1990</option>
<option value="1991">1991</option>
<option value="1992">1992</option>
<option value="1994">1994</option>
<option value="1995">1995</option>
<option value="1996">1996</option>
<option value="1997">1997</option>
<option value="1998">1998</option>
<option value="1999">1999</option>
<option value="2000">2000</option>
<option value="2001">2001</option>
<option value="2002">2002</option>
<option value="2003">2003</option>
<option value="2004">2004</option>
<option value="2005">2005</option>
<option value="2006">2006</option>
<option value="2007">2007</option>
<option value="2008">2008</option>
<option value="2009">2009</option>
<option value="2010">2010</option>
<option value="2011">2011</option>
</select>
</select></td>
</tr>
<tr>
<td valign="top">date_fin_stage</td>
<td>jour
<select name="jour2" id="jour2">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
<option value="13">13</option>
<option value="14">14</option>
<option value="15">15</option>
<option value="16">16</option>
<option value="17">17</option>
<option value="18">18</option>
<option value="19">19</option>
<option value="20">20</option>
<option value="21">21</option>
<option value="22">22</option>
<option value="23">23</option>
<option value="24">24</option>
<option value="25">25</option>
<option value="26">26</option>
<option value="27">27</option>
<option value="28">28</option>
<option value="29">29</option>
<option value="30">30</option>
<option value="31">31</option>
</select>
mois
<select name="mois2" id="mois2">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
</select>
année
<select name="an2" id="an2">
<option value="1971">1971</option>
<option value="1972">1972</option>
<option value="1973">1973</option>
<option value="1974">1974</option>
<option value="1975">1975</option>
<option value="1976">1976</option>
<option value="1977">1977</option>
<option value="1978">1978</option>
<option value="1979">1979</option>
<option value="1980">1980</option>
<option value="1981">1981</option>
<option value="1982">1982</option>
<option value="1983">1983</option>
<option value="1984">1984</option>
<option value="1985">1985</option>
<option value="1986">1986</option>
<option value="1987">1987</option>
<option value="1988">1988</option>
<option value="1989">1989</option>
<option value="1990">1990</option>
<option value="1991">1991</option>
<option value="1992">1992</option>
<option value="1994">1994</option>
<option value="1995">1995</option>
<option value="1996">1996</option>
<option value="1997">1997</option>
<option value="1998">1998</option>
<option value="1999">1999</option>
<option value="2000">2000</option>
<option value="2001">2001</option>
<option value="2002">2002</option>
<option value="2003">2003</option>
<option value="2004">2004</option>
<option value="2005">2005</option>
<option value="2006">2006</option>
<option value="2007">2007</option>
<option value="2008">2008</option>
<option value="2009">2009</option>
<option value="2010">2010</option>
<option value="2011">2011</option>
</select>
</select></td>
</tr>
<tr>
<td valign="top"><p>séminaires suivi
<label for="séminaires_suivi"> </label>
</p></td>
<td><textarea name="seminire" cols="60" rows="8"><?php if (isset($_POST['creer2'])) echo $b ?></textarea></td>
</tr>
<tr>
<td><label for="date_séminaire">date_debut_séminaire<br />
<br />
</label></td>
<td>jour
<select name="jour3" id="jour3">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
<option value="13">13</option>
<option value="14">14</option>
<option value="15">15</option>
<option value="16">16</option>
<option value="17">17</option>
<option value="18">18</option>
<option value="19">19</option>
<option value="20">20</option>
<option value="21">21</option>
<option value="22">22</option>
<option value="23">23</option>
<option value="24">24</option>
<option value="25">25</option>
<option value="26">26</option>
<option value="27">27</option>
<option value="28">28</option>
<option value="29">29</option>
<option value="30">30</option>
<option value="31">31</option>
</select>
mois
<select name="mois3" id="mois3">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
</select>
année
<select name="an3" id="an3">
<option value="1970">1970</option>
<option value="1971">1971</option>
<option value="1972">1972</option>
<option value="1973">1973</option>
<option value="1974">1974</option>
<option value="1975">1975</option>
<option value="1976">1976</option>
<option value="1977">1977</option>
<option value="1978">1978</option>
<option value="1979">1979</option>
<option value="1980">1980</option>
<option value="1981">1981</option>
<option value="1982">1982</option>
<option value="1983">1983</option>
<option value="1984">1984</option>
<option value="1985">1985</option>
<option value="1986">1986</option>
<option value="1987">1987</option>
<option value="1988">1988</option>
<option value="1989">1989</option>
<option value="1990">1990</option>
<option value="1991">1991</option>
<option value="1992">1992</option>
<option value="1994">1994</option>
<option value="1995">1995</option>
<option value="1996">1996</option>
<option value="1997">1997</option>
<option value="1998">1998</option>
<option value="1999">1999</option>
<option value="2000">2000</option>
<option value="2001">2001</option>
<option value="2002">2002</option>
<option value="2003">2003</option>
<option value="2004">2004</option>
<option value="2005">2005</option>
<option value="2006">2006</option>
<option value="2007">2007</option>
<option value="2008">2008</option>
<option value="2009">2009</option>
<option value="2010">2010</option>
<option value="2011">2011</option>
</select></td>
</tr>
<tr>
<td>date_fin_séminaire</td>
<td>jour
<select name="jour4" id="jour4">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
<option value="13">13</option>
<option value="14">14</option>
<option value="15">15</option>
<option value="16">16</option>
<option value="17">17</option>
<option value="18">18</option>
<option value="19">19</option>
<option value="20">20</option>
<option value="21">21</option>
<option value="22">22</option>
<option value="23">23</option>
<option value="24">24</option>
<option value="25">25</option>
<option value="26">26</option>
<option value="27">27</option>
<option value="28">28</option>
<option value="29">29</option>
<option value="30">30</option>
<option value="31">31</option>
</select>
mois
<select name="mois4" id="mois4">
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
</select>
année
<select name="an4" id="an4">
<option value="1971">1971</option>
<option value="1972">1972</option>
<option value="1973">1973</option>
<option value="1974">1974</option>
<option value="1975">1975</option>
<option value="1976">1976</option>
<option value="1977">1977</option>
<option value="1978">1978</option>
<option value="1979">1979</option>
<option value="1980">1980</option>
<option value="1981">1981</option>
<option value="1982">1982</option>
<option value="1983">1983</option>
<option value="1984">1984</option>
<option value="1985">1985</option>
<option value="1986">1986</option>
<option value="1987">1987</option>
<option value="1988">1988</option>
<option value="1989">1989</option>
<option value="1990">1990</option>
<option value="1991">1991</option>
<option value="1992">1992</option>
<option value="1994">1994</option>
<option value="1995">1995</option>
<option value="1996">1996</option>
<option value="1997">1997</option>
<option value="1998">1998</option>
<option value="1999">1999</option>
<option value="2000">2000</option>
<option value="2001">2001</option>
<option value="2002">2002</option>
<option value="2003">2003</option>
<option value="2004">2004</option>
<option value="2005">2005</option>
<option value="2006">2006</option>
<option value="2007">2007</option>
<option value="2008">2008</option>
<option value="2009">2009</option>
<option value="2010">2010</option>
<option value="2011">2011</option>
</select></td>
</tr>
</table>
<p> </p>
<p><center>
<input name="creer" type="submit" value="enregistrer" />
<input name="input" type="button" value="annuller" />
</center></p>
</form>
</div>
</div>
</div>
</div>
<!-- footer -->
<div id="footer">
<div class="container">
<div class="indent">
<div class="fright">Designed by: <a href="
https://www.templates.com/ "><img alt="website templates" src="images/templates-logo.gif" title="templates.com - website templates provider" /></a> Your <a href="http://www.templates.com/product/3d-models/" title="templates.com - website templates provider">3D Models</a> Marketplace</div>
</div>
</div>
</div>
</body>
</html>
et voila la page de l'insertion php
<?php
session_start();
// on teste si le visiteur a soumis le formulaire
if (isset($_POST['creer'])) {
if ((isset($_SESSION['login'])) && (isset ($_SESSION['pass']))) {
$base = mysql_connect ('localhost', 'root', '');
$bd= mysql_select_db ('cvtheque');
$sql='select role from personnel where login="'.$_SESSION['login'].'" and pass="'.$_SESSION['pass'].'" ';
$req = mysql_query($sql) or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error());
$data = mysql_fetch_array($req);
if ($data['role']=='responsable formation et stage'){
$aa1=(int) $_POST['an'];$mm1= (int)$_POST['mois'];$jj1=(int)$_POST['jour'];
$aa2=(int) $_POST['an2'];$mm2= (int)$_POST['mois2'];$jj2=(int)$_POST['jour2'];
$aa3=(int) $_POST['an3'];$mm3= (int)$_POST['mois3'];$jj3=(int)$_POST['jour3'];
$aa4=(int) $_POST['an4'];$mm4= (int)$_POST['mois4'];$jj4=(int)$_POST['jour4'];
$sql="
UPDATE info_formation_stage
SET
stage='".$_POST['stage']."',
date_deb_stage='".date("Y-m-d", mktime(0, 0, 0, $mm1,$jj1,$aa1))."',
date_fin_stage='".date("Y-m-d", mktime(0, 0, 0, $mm2,$jj2,$aa2))."',
seminere_suivi ='".$_POST['seminire']."',
date_deb_seminaire='".date("Y-m-d", mktime(0, 0, 0, $mm3,$jj3,$aa3))."',
date_fin_seminaire='".date("Y-m-d", mktime(0, 0, 0, $mm4,$jj4,$aa4))."'
WHERE matricule = '".$_POST['mat']."' " ;
mysql_query($sql) or die('Erreur SQL !'.$sql.'<br />'.mysql_error());
header('Location: services.html');
exit();
}
else{ echo'vous n ete pas un responsable formation et stage ';
exit();
}
}
}
mysql_close();
?>
et merci d'avance ;)
Afficher la suite