Bonjour, j'ai un ptit souci.
J'ai un formulaire ou l'on check les application qu'on souhaite et ou on rentre notre login :
Code :
- <form action="form.php" method="post" name="monform">
- <?php
- include("../Connections/connec.php" );
- mysql_select_db('satisfaction') or die('Erreur de selection '.mysql_error());
- $result = mysql_query("SELECT nom_appli FROM appli" );
- while ($row = mysql_fetch_array($result))
- {
- echo "<b>";
- echo $row["nom_appli"];
- echo " :</b>";
- echo "<input type=\"checkbox\" name=\"";
- echo $row["nom_appli"];
- echo "\"><br>";
- }
- echo "</td><td align=\"right\">";
- $result1 = mysql_query("SELECT nom_appli_fr FROM appli_fr" );
- while ($row = mysql_fetch_array($result1))
- {
- echo "<b>";
- echo $row["nom_appli_fr"];
- echo " :</b>";
- echo "<input type=\"checkbox\" name=\"";
- echo $row["nom_appli_fr"];
- echo "\"><br>";
- }
- echo "</td>";
- mysql_close();
- ?>
- </tr>
- </table>
- <br><br>
- <p align="center"><input name="login" type="text" />
- <br>
- <button style="cursor:hand; background:navy; color:white; border:solid 1px black;" type="submit">Commencer</button></p>
- </form>
|
et ensuite cela l'envoi vers un autre formulaire qui doit recuperer les application checké par l'utilisateur :
Code :
- <form action="Add.php" method="post" name="monform2" onsubmit="return donneavis()">
- <?php
- include("../Connections/connec.php" );
- mysql_select_db('satisfaction') or die('Erreur de selection '.mysql_error());
- $result = mysql_query("SELECT nom_appli FROM appli" );
- while ($row = mysql_fetch_array($result))
- {
- if(document.monform.$row["nom_appli"].checked==true)
- {
- echo "Pour l'application <b>";
- echo $row["nom_appli"];
- echo "</b> vous êtes :<br><br>";
- echo "<table width=\"600\">
- <tr>
- <td align=\"center\">";
- echo "
- <button style=\"cursor:hand; background:crimson; color:white; border:solid 1px black;\" type=\"button\" disabled >Très insatisfait</button>
- </td>";
- echo "<td align=\"center\">
- <button style=\"cursor:hand; background:firebrick; color:white; border:solid 1px black;\" type=\"button\" disabled >Insatisfait</button>
- </td>";
- echo "<td align=\"center\">
- <button style=\"cursor:hand; background:tan; color:white; border:solid 1px black;\" type=\"button\" disabled >Moyen</button>
- </td>";
- echo "<td align=\"center\">
- <button style=\"cursor:hand; background:greenyellow; color:white; border:solid 1px black;\" type=\"button\" disabled >Bien</button>
- </td>";
- echo "<td align=\"center\">
- <button style=\"cursor:hand; background:forestgreen; color:white; border:solid 1px black;\" type=\"button\" disabled >Exellent</button>
- </td>";
- echo "<td align=\"center\">
- <button style=\"cursor:hand; background:grey; color:white; border:solid 1px black;\" type=\"button\" disabled >Non utilisé</button>";
- echo "</td>
- </tr>
- <tr>";
- echo "<td align=\"center\">
- <input type=\"radio\" value=\"1\" name=\"";
- echo $row["nom_appli"];
- echo "\"></td>";
- echo "<td align=\"center\">
- <input type=\"radio\" value=\"2\" name=\"";
- echo $row["nom_appli"];
- echo "\"></td>";
- echo "<td align=\"center\">
- <input type=\"radio\" value=\"3\" name=\"";
- echo $row["nom_appli"];
- echo "\"></td>";
- echo "<td align=\"center\">
- <input type=\"radio\" value=\"4\" name=\"";
- echo $row["nom_appli"];
- echo "\"></td>";
- echo "<td align=\"center\">
- <input type=\"radio\" value=\"5\" name=\"";
- echo $row["nom_appli"];
- echo "\"></td>";
- echo "<td align=\"center\">
- <input type=\"radio\" value=\"NULL\" name=\"";
- echo $row["nom_appli"];
- echo "\"></td>";
- echo "</tr>
- </table>
- <br>";
- }
- }
|
Voila, c'est a mon avis cette ligne la qui plante :
Code :
- if(document.monform.$row["nom_appli"].checked==true)
|
Cela ne doit pas etre la bonne syntaxe, il me met aucune erreur, mais le probleme c'est qu'il me met toutes les applications alors que je ne les ait pas toutes coché au formulaire precedent