le_duc PlaTyPuS | je comprends pas pourquoi mes variables "confirmer" et "annuler" ne marche pas!!! j'suis newbie donc c'est surement une erreur à la con....
Code :
- <body>
- <?php
- include("lang_fr.inc.php" );
- $date = $jour[strftime("%w" )]." ".date("j" )." ".$mois[(strftime("%m" )-1)]." ".date("Y" );
- ?>
- <table class="tableau1" width="100%" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td width="45%" valign="top"><?php include ("logo.inc" ); ?></td>
- <td width="15%"> </td>
- <td width="40%">
- <div class="admin" align="right">
- <?php include ("fonction_recherche.inc" ); ?>
- </div></td>
- </tr>
- <tr>
- <td height="35" colspan="2"><a href="#nouveau">Enregistrer ?</a> / <a href="#modifier">Modifier
- - Supprimer ?</a></td>
- <td></td>
- </tr>
-
- <tr>
- <td colspan="3" height="0"> <hr /></td>
- </tr>
-
- <tr>
- <td colspan="3" height="0">
- <?php
- /* Déclarations des fonctions */
-
- function imprimer_form($Pseudo_new, $Post_new, $PM_new, $FTP_address, $FTP_new, $Mail_new, $date) {
- ?>
- <form method="post" action="administration.php">
- <p class="underline"><b>Enregistrer un nouveau proprio :</b></p>
- <table class="tableau1" width="100%" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td width="35%" height="45">Pseudo :
- <input type="text" name="Pseudo_new" value="<?php echo $Pseudo_new; ?>" /> </td>
- <td width="65%">Numéro post:
- <input type="text" name="Post_new" size=6 value="<?php echo $Post_new; ?>" /></td>
- </tr>
- <tr>
- <td height="45">Mail :
- <input type="text" name="Mail_new" size=30 value="<?php echo $Mail_new; ?>" /> </td>
- <td>Numéro PM :
- <input type="text" name="PM_new" size=8 value="<?php echo $PM_new; ?>" /></td>
- </tr>
- <tr>
- <td height="83">Adresse FTP :
- <input type="text" size=40 name="FTP_address" value="<?php echo $FTP_address; ?>" /></td>
- <td>Port du FTP :
- <input type="text" name="FTP_new" size="4" value="<?php echo $FTP_new; ?>" /></td>
- </tr>
- <tr>
- <td height="45" colspan="2">Date de mise à jour :
- <?php
- echo $date;
- ?>
- </td>
- </tr>
- <tr>
- <td height="45"><input type="submit" name="enregistrer" value="Envoyer" /></td>
- <td height="45"><input type="reset" name="Reset" value="Rétablir" /></td>
- </tr>
- </table>
- </form>
- <?php
- }
-
- function verif_form($Pseudo_new, $Post_new, $PM_new, $FTP_address, $FTP_new, $Mail_new, $date) {
- if(!$Pseudo_new || !$Post_new || !$PM_new || !$FTP_address || !$FTP_new):
- echo "<p class=\"comment3\">*Tous les champs sont obligatoires, sauf l'adresse mail.</p>";
- if(!$Pseudo_new) {
- echo "<span class=\"comment3\">--> Indiquez le <b>pseudo</b> !</span><br>"; }
- if(!$Post_new) {
- echo "<span class=\"comment3\">--> Indiquez le <b>numéro du post</b> !</span><br>"; }
- if(!$PM_new) {
- echo "<span class=\"comment3\">--> Indiquez le <b>numéro de PM</b> !</span><br>"; }
- if(!$FTP_address) {
- echo "<span class=\"comment3\">--> Indiquez l'<b>adresse du FTP</b> !</span><br>"; }
- if(!$FTP_new) {
- echo "<span class=\"comment3\">--> Indiquez le <b>port</b> du FTP !</span><br>"; }
- imprimer_form($Pseudo_new, $Post_new, $PM_new, $FTP_address, $FTP_new, $Mail_new, $date);
- else:
- confirmer_form($Pseudo_new, $Post_new, $PM_new, $FTP_address, $FTP_new, $Mail_new, $date);
- endif;
- }
- function confirmer_form($Pseudo_new, $Post_new, $PM_new, $FTP_address, $FTP_new, $Mail_new, $date) {
- echo "<p class=\"comment4\">Les informations vont être enregistrées dans la base de données, veuillez contrôler une dernière fois les données saisies.</p>";
- ?>
- <table class="tableau1" width="100%" border="0" cellspacing="0" cellpadding="0">
- <tr>
- <td width="29%" height="45">Pseudo : <b><?php echo $Pseudo_new; ?></b></td>
- <td width="71%">Numéro post : <b><?php echo $Post_new; ?></b></td>
- </tr>
- <tr>
- <td height="45">Mail : <b><?php echo $Mail_new; ?></b></td>
- <td>Numéro PM : <b><?php echo $PM_new; ?></td>
- </tr>
- <tr>
- <td height="65">Adresse FTP : <br><b><?php echo $FTP_address; ?></b></td>
- <td>Port du FTP : <b><?php echo $FTP_new; ?></b></td>
- </tr>
- <tr>
- <td height="45" colspan="2">Date de la mise à jour : <?php echo $date; ?></td>
- </tr>
- <tr>
- <form method="post" action="administration.php">
- <td height="45"><input type="submit" name="confirmer" value="Confirmer" /></td>
- <td height="45"><input type="reset" name="annuler" value="Annuler" /></td>
- </form>
- </tr>
- </table>
-
- <?php
- /* Début du programme de mise à jour de la base de données, après confirmation */
- if (isset($confirmer)):
- include ("connexion.php" );
- $request = "INSERT INTO spartateur_spartaproprios (Id, Pseudo, Post_address, Mail_address, PM_address, FTP_address, FTP_port) "
- . " VALUES (' ', '$Pseudo', '$Post', '$Mail', '$PM', '$FTP', '$Port') ";
- $resultat = mysql_query ($request, $connexion);
- if ($resultat)
- {
- echo "<p><strong>Le nouveau compte $Pseudo a bien été enregistré, voilà ses données : </strong></p>\n";
- echo "<table class=\"tableau1\" width=\"100%\" border=\"1\" cellpadding=\"3\">";
- while ($proprios = mysql_fetch_array ($resultat))
- {
- echo "<tr>
- <td width=\"17%\" height=\"38\"><a href=\"". $url ."". $proprios["Post_address"] ."\">". $proprios["Pseudo"] ."</a></td>\n
- <td width=\"38%\" height=\"38\">". $proprios["Mail_address"] ." / <a href=\"". $pm_url. "" .$proprios["PM_address"]. "\">PM</a></td>\n
- <td width=\"25%\" height=\"38\">". $proprios["FTP_address"] ."</td>\n
- <td width=\"5%\" height=\"38\" class=\"center\">". $proprios["FTP_port"] ."</td>\n
- <td width=\"15%\" height=\"38\" class=\"center\"><a href=\'javascript:PopupCentrer(\"verif.php?pseudo=". $proprios["Pseudo"] ."&adresse=". $proprios["FTP_address"] ."&port=". $proprios["FTP_port"] ."\",350,20,\"menubar=no,scrollbars=no,statusbar=no\" )\'>Online ?</a></td>\n
- </tr>";
- }
- echo "</table>";
- }
- else
- {
- echo "<B>Erreur dans l'enregistrement.</B><BR>";
- echo "<B>Message de MySQL :</B> " . mysql_error($connexion);
- }
- endif;
-
- if (isset($annuler)):
- imprimer_form($Pseudo_new, $Post_new, $PM_new, $FTP_address, $FTP_new, $Mail_new, $date);
- endif;
- /* Fin de la fonction confirmer_form */
- }
-
- /* Début du programme principal */
- if (!$enregistrer):
- imprimer_form("", "", "", "", "", "", $date);
- else:
- verif_form($Pseudo_new, $Post_new, $PM_new, $FTP_address, $FTP_new, $Mail_new, $date);
- endif;
- ?>
- </td>
- </tr>
-
- <tr>
- <td colspan="3" height="0"><hr /></td>
- </tr>
- </table>
- </body>
|
oui, c pas mal long mais merci aux gens qui m'aideront!!!
@++ |