Bonjour,
J'ai un formulaire général qui quand je valide doit exécuter le code situé dans v_demande.php
Or il ne valide rien du tout.
Dans ce formulaire, j'ai deux autres formulaire, qui eux, s'exécutent en rafraichissant la page.
J'utilise la méthode POST dans le premier et GET dans les 2 suivants.
Est ce que c'est ça le problème ?
Voici mon code, et merci de votre aide.
<?php
/***************************************************************************************
* Créé le 22/02/2007 - AS - Partie utilisateur, création d'une demande. *
* *
* *
* *
****************************************************************************************/
include ('connex.php');
include ('fonctions.php');
// Protection de la page
session_start();
if(!isset($_SESSION['nom']))
{
header('location:auth.htm');
exit;
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<title>Applicatif finances</title>
<link rel="stylesheet" href="style.css" type="text/css" />
<link rel="shortcut icon" href="favicon.ico">
<script language="JavaScript">
function loadURL(formulaire)
{
if (formulaire.ListeUrl.selectedIndex != 0)
{
location.href = formulaire.ListeUrl.options[formulaire.ListeUrl.selectedIndex].value;
}
}
function loadURL2(formulaire)
{
if (formulaire.ListeUrl2.selectedIndex != 0)
{
location.href = formulaire.ListeUrl2.options[formulaire.ListeUrl2.selectedIndex].value;
}
}
</script>
</head>
<body>
<table width="90%" border="1" align="center" cellpadding="0" cellspacing="0" bgcolor="#0099FF" bordercolor="#33CCFF" frame="box" rules="none">
<tr><td align="center"><img align="middle" src="img/titre.jpg"></td></tr>
<tr><td height="53"> </td></tr>
<tr>
<td>
<table border="0" width="80%" align="center">
<form name="demande" action="test.php" method="post">
<tr>
<td height="40" colspan=>Date</td>
<td><input type="text" name="date" value="<?php echo date('d-m-Y'); ?>" size="10"></td>
<td> </td>
<td> </td>
<td> </td>
<td> </td>
</tr>
<tr>
<td height="40">Demandeur</td>
<?php
$sql="SELECT m.nom,m.prnm,m.gest,m.tel FROM membre m
WHERE m.login='".$_SESSION['nom']."'";
//echo $sql;
$exec=mysql_query($sql);
$res=mysql_fetch_row($exec);
?>
<td><input type="text" name="pseudo" value="<?php echo $res[0]." ".$res[1]; ?>" size="25"></td>
<td height="40">Gestionnaire</td>
<td><input type="text" name="gest" value="<?php echo $res[2]; ?>" size="6"></td>
<td height="40">Télèphone</td>
<td><input type="text" name="tel" value="<?php echo $res[3]; ?>" size="4"></td>
</tr>
<tr>
<td height="40">Type de demande</td>
<td><select name="type">
<option value="">- Type de demande -</option>
<?php
$sql="SELECT type_dem,libelle FROM type";
echo $sql;
$res=mysql_query($sql) or die (mysql_error());
while($row=mysql_fetch_array($res))
{
echo "<option value='".$row['type_dem']."'>".$row['libelle']."</option>";
}
?>
</select></td>
<td>Collectivité</td>
<td><input type="text" name="cod_coll" size="6"></td>
<td> </td>
<td> </td>
</tr>
<tr>
<td>Montant</td>
<td colspan="5"><input type="text" name="montant" size="10"></td>
</tr>
<tr><td colspan="6"> </td></tr>
<tr>
<td height="40" colspan="6">
<table width="85%" align="center" border="0">
<th align="center" colspan="6">Enveloppe bénéfciaire</th>
<tr>
<td colspan="4">
<form id="formulaire" method="get" action="">
<select name="env_b" id="ListeUrl" onChange="loadURL(this.form)">
<option value="">- Enveloppe -</option>
<?php
$sql="SELECT num_env_b FROM env_bene,membre
WHERE env_bene.gestionnaire=membre.gest
AND membre.login='".$_SESSION['nom']."'
ORDER BY num_env_b DESC";
echo $sql;
$res=mysql_query($sql) or die (mysql_error());
while($row=mysql_fetch_array($res))
{
echo "<option value='demande.php?num_b=".$row['num_env_b']."'>".$row['num_env_b']."</option>";
}
?>
</select>
</form>
</td>
</tr>
<?php
if (isset($_GET['num_b']))
{
$sql="SELECT article_b,chapitre_b,fonction_b,libelle FROM env_bene WHERE num_env_b='".$_GET['num_b']."'";
$res=mysql_query($sql) or die (mysql_error());
while($row=mysql_fetch_array($res))
{
?>
<tr>
<td colspan="4" height="40">Libellé <input type="text" name="lib_b" value="<?php echo $row['libelle']; ?>" size="75"></td>
</tr>
<tr>
<td height="40">Num <input type="text" name="num_b" value="<?php echo $_GET['num_b']; ?>" size="4"></td>
<td>Article <input type="text" name="article_b" value="<?php echo $row['article_b']; ?>" size="4"></td>
<td>Chapitre <input type="text" name="chapitre_b" value="<?php echo $row['chapitre_b']; ?>" size="4"></td>
<td>Fonction <input type="text" name="fonction_b" value="<?php echo $row['fonction_b']; ?>" size="4"></td>
</tr>
<?php }} ?>
</table>
</td>
</tr>
<tr>
<td height="40" colspan="6">
<table width="85%" align="center" border="0">
<th align="center" colspan="6">Enveloppe compensatrice</th>
<tr>
<td colspan="4">
<!-- <form id="formulaire2" method="get" action="">
<select name="env_c" id="ListeUrl2" onChange="loadURL2(this.form)">
<option value="">- Enveloppe -</option>
<?php
/* $sql="SELECT num_env_c FROM env_comp,membre
WHERE env_comp.gestionnaire=membre.gest
AND membre.login='".$_SESSION['nom']."'
ORDER BY num_env_c DESC";
echo $sql;
$res=mysql_query($sql) or die (mysql_error());
while($row=mysql_fetch_array($res))
{
echo "<option value='demande.php?num_b=".$_GET['num_b']."&num_c=".$row['num_env_c']."'>".$row['num_env_c']."</option>";
}*/
?>
</select>
</form>-->
</td>
</tr>
<?php
if (isset($_GET['num_c']))
{
$sql="SELECT article_c,chapitre_c,fonction_c,libelle FROM env_comp WHERE num_env_c='".$_GET['num_c']."'";
$res=mysql_query($sql) or die (mysql_error());
while($row=mysql_fetch_array($res))
{
?>
<tr>
<td colspan="4" height="40">Libellé <input type="text" name="lib_c" value="<?php echo $row['libelle']; ?>" size="75"></td>
</tr>
<tr>
<td height="40">Num <input type="text" name="num_c" value="<?php echo $_GET['num_c']; ?>" size="4"></td>
<td>Article <input type="text" name="article_c" value="<?php echo $row['article_c']; ?>" size="4"></td>
<td>Chapitre <input type="text" name="chapitre_c" value="<?php echo $row['chapitre_c']; ?>" size="4"></td>
<td>Fonction <input type="text" name="fonction_c" value="<?php echo $row['fonction_c']; ?>" size="4"></td>
</tr>
<?php }} ?>
</table>
</td>
</tr>
<tr><td colspan="6"> </td></tr>
<tr>
<td colspan="6">
<table width="85%" align="center" border="0">
<th align="center" colspan="6">Motivations</th>
<tr>
<td align="center">
<textarea name="motiv" cols="60" rows="15"></textarea>
</td>
</tr>
</table>
</td>
</tr>
<tr><td colspan="6" align="center" height="40"><input type="submit" value="Valider"></td></tr>
</form>
</table>
</td>
</tr>
<tr>
<td height="150" colspan="2"> </td>
</tr>
<tr><td id="pied" colspan="2">Applicatif dédié aux finances - Développé par le service Informatique et Télécommunications - Mars 2007</td></tr>
</table>
</body>
</html>
Didine