Gestion de Contenu, de Communauté et de groupes de travail collaboratif - Open Source, français, sécurisé, stable et performant

  • MODULES

    Pour étendre les nombreuses fonctionnalités disponibles de base - modules.npds.org est à votre disposition.

    Des modules complémentaires, une communauté de développeurs active, des forums pour vos questions ... NPDS  est aussi une plateforme de développement !
  • STYLES

    Vous cherchez des thèmes graphiques pour votre portail ou votre communauté : styles.npds.org est à votre disposition.

    Des thèmes du plus simple au plus sophistiqué. Des thèmes facilement modifiables et toujours en Open-Source - Laissez simplement parler votre imagination !
  • BIBLES

    La documentation indispensable pour personnaliser et exploiter toute la puissante de NPDS  est à votre disposition sur bible.npds.org.

    Vous pouvez participer à l'effort de documentation - rien de plus simple : contactez un membre de la Team de développement et nous vous ouvrirons un compte sur le Wiki !
Devenir membre    |    Identifiant : Mot de Passe : -
Au delà de la gestion de contenu 'classique', NPDS met en oeuvre un ensemble de fonctions spécifiquement dédiées à la gestion de Communauté et de groupes de travail collaboratif.
Il s'agit d'un Content & Community Management System (CCMS) robuste, sécurisé, complet, performant et parlant vraiment français.

Gérez votre Communauté d'utilisateurs, vos groupes de travail collaboratif, publiez, gérez et organisez votre contenu grâce aux puissants outils disponibles de base.
  • Multi langues (Français, Anglais, Allemand, Espagnol, Chinois)
  • Respect des standards : UTF8, XHTML, CSS, ...
  • Système de blocs avancés
  • Installation et administration complète et centralisée
  • Editeur HTML intégré
  • Gestionnaire de fichier en ligne
  • Gestion des groupes de membres
  • Ecriture collaborative de documents (PAD)
  • Forums évolués
  • Mini-sites (pour les membres et les groupes de travail)
  • Chat temp réel
  • Système de News et de rubriques complet (édition, révision, publication)
  • ...
Gratuit et libre (Open-Source), développé en PHP, NPDS est personnalisable grâce à de nombreux thèmes et modules et ne requiert que quelques compétences de base.
NPDS Workplace - groupe de travail collaboratif
 NPDS WorkSpace - tous l'univers du travail collaboratif.
Modéré par : developpeur jpb Jireck 
Index du Forum » » Le coin des codeurs » » Besoin d'aide sur un script PHP
AuteurBesoin d'aide sur un script PHP
arnodu59
437      

arnodu59
  Posté : 19-03-2004 15:06

Bonjour,

J'aurais besoin de vos services, concernant un script php si vous voulez bien ;)

J'ai un problème de récupération de formulaire.

Je vous explique le problème :

Via une page qui se nome index.php, je demande combien de compétition il y a pour le mois de Janvier, Février etc...
Les données sont transmise à la page competition_nv_saison.php qui, a l'aide de boucle for génére le formulaire.

Ensuite, les données de la page competition_nv_saison.php sont transmisse à la page save_compétition_nv_saison.php
Mais la, je ne sais pas comment faire pour enregistrer les information dans la base de donnée :(

Voici la structure de la base de donnée :

########################################
CREATE TABLE competition_calendrier (
mois varchar(15) NOT NULL default '',
id_mois varchar(30) NOT NULL default '',
dates varchar(10) NOT NULL default '',
activite varchar(15) NOT NULL default '',
action text NOT NULL,
lieux varchar(200) NOT NULL default '',
saison varchar(6) NOT NULL default '',
PRIMARY KEY (mois)
) TYPE=MyISAM;
########################################

Je vous avourais que je ne sais plus comment faire...
Je vous donne les pages index.php, competition_nv_saison.php

<p>########## INDEX.PHP ##########<br>
<p align="center"><b><u>Administration des compétitions</u></b></p><br>
<br /><br>
Ajouter le nouveau calendrier des compétitions<hr /><br>
<p align="center"><font color="#FF0000"><b><u>Attention, en ajoutant un<br>
calendrier, vous supprimerez automatiquement l'ancien !</u></b></font></p><br /><br>
<form action="competition_nv_saison.php" method="post"><br>
<table border="0" width="100%"><br>
<tr><br>
<td width="100%"><br>
<table border="0" width="100%"><br>
<tr><br>
<td width="50%" align="center"><br>
<p align="center">Saison :</td><br>
<td width="50%"><br>
<p align="center"><input class="TEXTBOX_STANDARD" type="text" name="saison" size="7" /></td><br>
</tr><br>
<tr><br>
<td width="50%" align="center">Nombre de compétition au mois de<br>
Novembre :</td><br>
<td width="50%" align="center"><input class="TEXTBOX_STANDARD" type="text" name="nb_novembre" size="1" /></td><br>
</tr><br>
<tr><br>
<td width="50%" align="center">Nombre de compétition au<br>
mois de Décembre :</td><br>
<td width="50%" align="center"><input class="TEXTBOX_STANDARD" type="text" name="nb_decembre" size="1" /></td><br>
</tr><br>
<tr><br>
<td width="50%" align="center">Nombre de compétition au<br>
mois de Janvier :</td><br>
<td width="50%" align="center"><input class="TEXTBOX_STANDARD" type="text" name="nb_janvier" size="1" /></td><br>
</tr><br>
<tr><br>
<td width="50%" align="center">Nombre de compétition au<br>
mois de Février :</td><br>
<td width="50%" align="center"><input class="TEXTBOX_STANDARD" type="text" name="nb_fevrier" size="1" /></td><br>
</tr><br>
<tr><br>
<td width="50%" align="center">Nombre de compétition au<br>
mois de Mars :</td><br>
<td width="50%" align="center"><input class="TEXTBOX_STANDARD" type="text" name="nb_mars" size="1" /></td><br>
</tr><br>
<tr><br>
<td width="50%" align="center">Nombre de compétition au<br>
mois de Avril :</td><br>
<td width="50%" align="center"><input class="TEXTBOX_STANDARD" type="text" name="nb_avril" size="1" /></td><br>
</tr><br>
<tr><br>
<td width="50%" align="center">Nombre de compétition au<br>
mois de Mai :</td><br>
<td width="50%" align="center"><input class="TEXTBOX_STANDARD" type="text" name="nb_mai" size="1" /></td><br>
</tr><br>
<tr><br>
<td width="50%" align="center">Nombre de compétition au<br>
mois de Juin :</td><br>
<td width="50%" align="center"><input class="TEXTBOX_STANDARD" type="text" name="nb_juin" size="1" /></td><br>
</tr><br>
</table><br>
</td><br>
</tr><br>
</table><br>
<p align="center"><input class="BOUTON_STANDARD" type="submit" value="Créer un nouveau calendrier" /></p><br>
</form><br>
##################### ####<br>
<br>
########## COMPETITION_NV_SAISON.PHP ##########<br>
<?<br>
$competition_max = "20";<br>
if($nb_novembre >= "$competition_max" or $nb_decembre >= "$competition_max" or $nb_janvier >= "$competition_max" or $nb_fevrier >= "$competition_max" or $nb_mars >= "$competition_max" or $nb_avril >= "$competition_max" or $nb_mai >= "$competition_max" or $nb_juin >= "$competition_max")<br>
{<br>
echo "<center>\n"<br>
."<br />\n"<br>
."<font color=red>Êtes-vous sur que 30 compétitions pour un mois soit possible ???</font>\n"<br>
."<br />\n"<br>
."<br />\n"<br>
."<a href=\"!!!!javascript!!!!:history.back(-1);\">Corriger mon erreur</a>\n"<br>
."</center>\n";<br&g t;
}else{<br>
?><br>
<br /><br>
<center><br>
Créer un nouveau calendrier.<br /><br>
Le champ dates doit-être sous la forume 24 ou 24-25 !<br /><br>
<font color=red>Attention, tout les champs doivent-être remplis !</font><br /><br /><br>
</center><br>
<?<br>
//<form action="admin.php?op=Extend-Admin-SubModule&ModPath=administration/com petition&ModStart=save_competition_nv_saison" method="post"><br>
?><br>
<form action="test.php" method="post"><br>
<input type="hidden" name="nb_novembre" value="<? echo $nb_novembre; ?>" /><br>
<input type="hidden" name="nb_decembre" value="<? echo $nb_decembre; ?>" /><br>
<input type="hidden" name="nb_janvier" value="<? echo $nb_janvier; ?>" /><br>
<input type="hidden" name="nb_fevrier" value="<? echo $nb_fevrier; ?>" /><br>
<input type="hidden" name="nb_mars" value="<? echo $nb_mars; ?>" /><br>
<input type="hidden" name="nb_avril" value="<? echo $nb_avril; ?>" /><br>
<input type="hidden" name="nb_mai" value="<? echo $nb_mai; ?>" /><br>
<input type="hidden" name="nb_juin" value="<? echo $nb_juin; ?>" /><br>
<input type="hidden" name="saison" value="<? echo $saison; ?>" /><br>
<br>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%"><br>
<tr><br>
<td width="11%"><br>
<p align="center"><b>DATES</b></td><br>
<td width="18%"><br>
<p align="center"><b>ACTIVITÉ</b></td><br> <td width="51%"><br>
<p align="center"><b>ACTIONS</b></td><br>
<td width="20%"><br>
<p align="center"><b>LIEUX</b></td><br>
</tr><br>
</table><br>
<br>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%"><br>
<tr><br>
<td width="100%"><br>
<p align="center"><i><b>Novembre</b></i></ td><br>
</tr><br>
</table><br>
<?<br>
for ($n = 1; $n <= $nb_novembre; $n++) {<br>
?><br>
<input type="hidden" name="id_mois_compete" value="novembre_<? echo $n; ?>" /><br>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%"><br>
<tr><br>
<td width="11%" align="center"><input class="TEXTBOX_STANDARD" type="text" name="date_novembre_<? echo $n; ?>" size="5"></td><br>
<td width="18%"><br>
<p align="center"><select class="TEXTBOX_STANDARD" size="1" name="activite_novembre_<? echo $n; ?>"><br>
<option>GAM</option><br>
<option>GAF</option><br>
<option>ga-gr-tr</option><br>
<option>GAM-GAF</option><br>
<option>CE-CG-GAM-GAF</option><br>
<option>GAM-GAF-GR</option><br>
<option>GAM-EUROTEAM</option><br>
<br>
</select></td><br>
<td width="51%"> <input class="TEXTBOX_STANDARD" type="text" name="actions_novembre_<? echo $n; ?>" size="62"> </td><br>
<td width="20%"><br>
<p align="center"><input class="TEXTBOX_STANDARD" type="text" name="lieux_novembre_<? echo $n; ?>" size="20"></td><br>
</tr><br>
</table><br>
<?}?><br> <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%"><br>
<tr><br>
<td width="100%"><br>
<p align="center"><i><b>Décembre</b></i></ td><br>
</tr><br>
</table><br>
<?<br>
for ($d = 1; $d <= $nb_decembre; $d++) {<br>
?><br>
<input type="hidden" name="id_mois_compete" value="decembre_<? echo $d; ?>" /><br>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%"><br>
<tr><br>
<td width="11%" align="center"><input class="TEXTBOX_STANDARD" type="text" name="date_decembre_<? echo $d; ?>" size="5"></td><br>
<td width="18%"><br>
<p align="center"><select class="TEXTBOX_STANDARD" size="1" name="activite_decembre_<? echo $d; ?>"><br>
<option>GAM</option><br>
<option>GAF</option><br>
<option>ga-gr-tr</option><br>
<option>GAM-GAF</option><br>
<option>CE-CG-GAM-GAF</option><br>
<option>GAM-GAF-GR</option><br>
<option>GAM-EUROTEAM</option><br>
<br>
</select></td><br>
<td width="51%"> <input class="TEXTBOX_STANDARD" type="text" name="actions_decembre_<? echo $d; ?>" size="62"> </td><br>
<td width="20%"><br>
<p align="center"><input class="TEXTBOX_STANDARD" type="text" name="lieux_decembre_<? echo $d; ?>" size="20"></td><br>
</tr><br>
</table><br>
<?}?><br> <br>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%"><br>
<tr><br>
<td width="100%"><br>
<p align="center"><i><b>Janvier</b></i></t d><br>
</tr><br>
</table><br>
<?<br>
for ($j = 1; $j <= $nb_janvier; $j++) {<br>
?><br>
<input type="hidden" name="id_mois_compete" value="janvier_<? echo $j; ?>" /><br>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%"><br>
<tr><br>
<td width="11%" align="center"><input class="TEXTBOX_STANDARD" type="text" name="date_janvier_<? echo $j; ?>" size="5"></td><br>
<td width="18%"><br>
<p align="center"><select class="TEXTBOX_STANDARD" size="1" name="activite_janvier_<? echo $j; ?>"><br>
<option>GAM</option><br>
<option>GAF</option><br>
<option>ga-gr-tr</option><br>
<option>GAM-GAF</option><br>
<option>CE-CG-GAM-GAF</option><br>
<option>GAM-GAF-GR</option><br>
<option>GAM-EUROTEAM</option><br>
<br>
</select></td><br>
<td width="51%"> <input class="TEXTBOX_STANDARD" type="text" name="actions_janvier_<? echo $j; ?>" size="62"> </td><br>
<td width="20%"><br>
<p align="center"><input class="TEXTBOX_STANDARD" type="text" name="lieux_janvier_<? echo $j; ?>" size="20"></td><br>
</tr><br>
</table><br>
<?}?><br> <br>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%"><br>
<tr><br>
<td width="100%"><br>
<p align="center"><i><b>Février</b></i></t d><br>
</tr><br>
</table><br>
<?<br>
for ($f = 1; $f <= $nb_fevrier; $f++) {<br>
?><br>
<input type="hidden" name="id_mois_compete" value="fevrier_<? echo $f; ?>" /><br>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%"><br>
<tr><br>
<td width="11%" align="center"><input class="TEXTBOX_STANDARD" type="text" name="date_fevrier_<? echo $f; ?>" size="5"></td><br>
<td width="18%"><br>
<p align="center"><select class="TEXTBOX_STANDARD" size="1" name="activite_fevrier_<? echo $f; ?>"><br>
<option>GAM</option><br>
<option>GAF</option><br>
<option>ga-gr-tr</option><br>
<option>GAM-GAF</option><br>
<option>CE-CG-GAM-GAF</option><br>
<option>GAM-GAF-GR</option><br>
<option>GAM-EUROTEAM</option><br>
<br>
</select></td><br>
<td width="51%"> <input class="TEXTBOX_STANDARD" type="text" name="actions_fevrier_<? echo $f; ?>" size="62"> </td><br>
<td width="20%"><br>
<p align="center"><input class="TEXTBOX_STANDARD" type="text" name="lieux_fevrier_<? echo $f; ?>" size="20"></td><br>
</tr><br>
</table><br>
<?}?><br> <br>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%"><br>
<tr><br>
<td width="100%"><br>
<p align="center"><i><b>Mars</b></i></td&g t;<br>
</tr><br>
</table><br>
<?<br>
for ($m = 1; $m <= $nb_mars; $m++) {<br>
?><br>
<input type="hidden" name="id_mois_compete" value="mars_<? echo $m; ?>" /><br>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%"><br>
<tr><br>
<td width="11%" align="center"><input class="TEXTBOX_STANDARD" type="text" name="date_mars_<? echo $m; ?>" size="5"></td><br>
<td width="18%"><br>
<p align="center"><select class="TEXTBOX_STANDARD" size="1" name="activite_mars_<? echo $m; ?>"><br>
<option>GAM</option><br>
<option>GAF</option><br>
<option>ga-gr-tr</option><br>
<option>GAM-GAF</option><br>
<option>CE-CG-GAM-GAF</option><br>
<option>GAM-GAF-GR</option><br>
<option>GAM-EUROTEAM</option><br>
<br>
</select></td><br>
<td width="51%"> <input class="TEXTBOX_STANDARD" type="text" name="actions_mars_<? echo $m; ?>" size="62"> </td><br>
<td width="20%"><br>
<p align="center"><input class="TEXTBOX_STANDARD" type="text" name="lieux_mars_<? echo $m; ?>" size="20"></td><br>
</tr><br>
</table><br>
<?}?><br> <br>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%"><br>
<tr><br>
<td width="100%"><br>
<p align="center"><i><b>Avril</b></i></td& gt;<br>
</tr><br>
</table><br>
<?<br>
for ($a = 1; $a <= $nb_avril; $a++) {<br>
?><br>
<input type="hidden" name="id_mois_compete" value="avril_<? echo $a; ?>" /><br>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%"><br>
<tr><br>
<td width="11%" align="center"><input class="TEXTBOX_STANDARD" type="text" name="date_avril_<? echo $a; ?>" size="5"></td><br>
<td width="18%"><br>
<p align="center"><select class="TEXTBOX_STANDARD" size="1" name="activite_avril_<? echo $a; ?>"><br>
<option>GAM</option><br>
<option>GAF</option><br>
<option>ga-gr-tr</option><br>
<option>GAM-GAF</option><br>
<option>CE-CG-GAM-GAF</option><br>
<option>GAM-GAF-GR</option><br>
<option>GAM-EUROTEAM</option><br>
<br>
</select></td><br>
<td width="51%"> <input class="TEXTBOX_STANDARD" type="text" name="actions_avril_<? echo $a; ?>" size="62"> </td><br>
<td width="20%"><br>
<p align="center"><input class="TEXTBOX_STANDARD" type="text" name="lieux_avril_<? echo $a; ?>" size="20"></td><br>
</tr><br>
</table><br>
<?}?><br> <br>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%"><br>
<tr><br>
<td width="100%"><br>
<p align="center"><i><b>Mai</b></i></td> ;<br>
</tr><br>
</table><br>
<?<br>
for ($ma = 1; $ma <= $nb_mai; $ma++) {<br>
?><br>
<input type="hidden" name="id_mois_compete" value="mai_<? echo $ma; ?>" /><br>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%"><br>
<tr><br>
<td width="11%" align="center"><input class="TEXTBOX_STANDARD" type="text" name="date_mai_<? echo $ma; ?>" size="5"></td><br>
<td width="18%"><br>
<p align="center"><select class="TEXTBOX_STANDARD" size="1" name="activite_mai_<? echo $ma; ?>"><br>
<option>GAM</option><br>
<option>GAF</option><br>
<option>ga-gr-tr</option><br>
<option>GAM-GAF</option><br>
<option>CE-CG-GAM-GAF</option><br>
<option>GAM-GAF-GR</option><br>
<option>GAM-EUROTEAM</option><br>
<br>
</select></td><br>
<td width="51%"> <input class="TEXTBOX_STANDARD" type="text" name="actions_mai_<? echo $ma; ?>" size="62"> </td><br>
<td width="20%"><br>
<p align="center"><input class="TEXTBOX_STANDARD" type="text" name="lieux_mai_<? echo $ma; ?>" size="20"></td><br>
</tr><br>
</table><br>
<?}?><br> <br>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%"><br>
<tr><br>
<td width="100%"><br>
<p align="center"><i><b>Juin</b></i></td&g t;<br>
</tr><br>
</table><br>
<br>
<?< br>
for ($ju = 1; $ju <= $nb_juin; $ju++) {<br>
?><br>
<input type="hidden" name="id_mois_compete" value="juin_<? echo $ju; ?>" /><br>
<table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%"><br>
<tr><br>
<td width="11%" align="center"><input class="TEXTBOX_STANDARD" type="text" name="date_juin_<? echo $ju; ?>" size="5"></td><br>
<td width="18%"><br>
<p align="center"><select class="TEXTBOX_STANDARD" size="1" name="activite_juin_<? echo $ju; ?>"><br>
<option>GAM</option><br>
<option>GAF</option><br>
<option>ga-gr-tr</option><br>
<option>GAM-GAF</option><br>
<option>CE-CG-GAM-GAF</option><br>
<option>GAM-GAF-GR</option><br>
<option>GAM-EUROTEAM</option><br>
<br>
</select></td><br>
<td width="51%"> <input class="TEXTBOX_STANDARD" type="text" name="actions_juin_<? echo $ju; ?>" size="62"> </td><br>
<td width="20%"><br>
<p align="center"><input class="TEXTBOX_STANDARD" type="text" name="lieux_juin_<? echo $ju; ?>" size="20"></td><br>
</tr><br>
</table><br>
<?}?><br> <br /><br>
<center><input class="BOUTON_STANDARD" type="submit" value="Enregistrer les nouvelles dates"></center><br>
</form></code><br&g t;
#############################<br>
<br>
########## SAVE_COMPETITION_NV_SAISON.PHP ##########<br>
<br>
C'est sur cette page que je bloque... J'ai essayé :
if (count($HTTP_POST_VARS)>1) {<br>
reset ($HTTP_POST_VARS);<br>
while (list($var,$val)=each($HTTP_POST_VARS))<br>
echo "...................................";<br>
} else {<br>
reset ($HTTP_GET_VARS);<br>
while (list($var,$val)=each($HTTP_GET_VARS))<br>
echo "...................................";<br>
echo "</UL>\n";<br>
}<br>
</p>

Ma is comment les insérer dans la base de donnée ? vu la structure...
De plus, après, je lit la base de donnée afin de créer un tableau (cf : <a href='http://www.servlycee.com/AGL/modules.php?ModPath=menu&ModStart=competition' target='_blank' class='NOIR'>http://www.servlycee.com/AGL/modules.php?ModPath=menu&ModStart=competition</a>)

Voilà, en éspérant que vous pourriez m'aider .

Cordialement,
ENGELAERE Arnaud.

<font size=1>[ Message édité par : arnodu59 : 19-03-2004 15:07 ]</font>

<font size=1>[ Message édité par : arnodu59 : 19-03-2004 15:09 ]</font>

[ Message édité par : developpeur : 19-03-2004 17:36 ]

  Profil  www  
arnodu59
437      

arnodu59
  Posté : 22-03-2004 21:06

Personne ne sais comment résoudre mon problème ?

Je pose toujours des questions difficile moi

  Profil  www  
developpeur
24581       
 

developpeur
  Posté : 22-03-2004 21:09

c'est aussi que ton script est un peut long .... et que j'ai pas le temps aujourd'hui

  Profil  E-mail  www  
Sauter à :

Temps : 0.0282 seconde(s)