IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Langage PHP Discussion :

[Dates] Variable persistante à arrêter!


Sujet :

Langage PHP

  1. #1
    Membre du Club
    Profil pro
    Inscrit en
    Décembre 2006
    Messages
    100
    Détails du profil
    Informations personnelles :
    Âge : 49
    Localisation : Belgique

    Informations forums :
    Inscription : Décembre 2006
    Messages : 100
    Points : 54
    Points
    54
    Par défaut [Dates] Variable persistante à arrêter!
    Bonsoir à tous,
    existe t'il un moyen d'arreter le passage d'une variable par url???
    ma question peut paraitre un peu étrange, mais voici ce qui se passe:
    en cliquant sur un lien pour supprimer un enregistrement, je déclare ma variable j'arrive alors sur la page de suppresion, me demandant la confirmation, et en cliquant sur un bouton, je supprimer l'enregistrement, et je renvoie directement sur la page affichant les autres enregistrements...
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
     
    if ((isset($_POST['DevisId'])) && ($_POST['DevisId'] != "")) {
      $deleteSQL = sprintf("DELETE FROM devis WHERE DevisId=%s",
                           GetSQLValueString($_POST['DevisId'], "int"));
     
      mysql_select_db($database_ProgFacture, $ProgFacture);
      $Result1 = mysql_query($deleteSQL, $ProgFacture) or die(mysql_error());
     
      $deleteGoTo = "AfficherDocument.php";
      if (isset($_SERVER['QUERY_STRING'])) {
        $deleteGoTo .= (strpos($deleteGoTo, '?')) ? "&" : "?";
        $deleteGoTo .= $_SERVER['QUERY_STRING'];
      }
      header(sprintf("Location: %s", $deleteGoTo));
    }
    de cette page affichagedocument, je peux soit en cliquant sur un lien afficher un autre document, soit en créer un nouveau, toujous via un bouton (post), mais la, il affiche dans mon url le numéro d'enregistrement du nouveau document, mais en plus, il indique toujours l'ancien numéro, celui que j'ai effacé....
    bref, ca donne ceci....
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    /Documents/CreationDevis.php?recordID2=30&recordID=39&recordID2=25
    vous voyez, il envoie bel et bien l'id du nouveau devis(recordID2=30), mais il affiche également plus loin, un second recordID2, et celui la porte le numéro de l'ancien enregistrement... ce qui me provoque un bug... bref, cata...

    d'ou ma question, existe t'il un moyen de "remettre à zéro" mon url, aprés l'avoir utilisé...?
    merci d'avance pour ce cas un peu "zarbi"....

  2. #2
    Membre expert
    Homme Profil pro
    Architecte de système d'information
    Inscrit en
    Juillet 2004
    Messages
    2 725
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 37
    Localisation : France, Sarthe (Pays de la Loire)

    Informations professionnelles :
    Activité : Architecte de système d'information

    Informations forums :
    Inscription : Juillet 2004
    Messages : 2 725
    Points : 3 338
    Points
    3 338
    Par défaut
    Bon deja c'est quoi tout ces sprintf.... ils n'ont aucun interet la!

    Sinon pour pourrai avoir ton code complet? Parce que la on ne voit pas l'apelle a la page CreationDevis.php
    Par pitié !!!! :Si vous ne savez pas faire cliquez ici !
    Citation Envoyé par Marc-L
    C'est dommage que parfois tu sois aussi lourd que tu as l'air intelligent…

  3. #3
    Membre du Club
    Profil pro
    Inscrit en
    Décembre 2006
    Messages
    100
    Détails du profil
    Informations personnelles :
    Âge : 49
    Localisation : Belgique

    Informations forums :
    Inscription : Décembre 2006
    Messages : 100
    Points : 54
    Points
    54
    Par défaut
    Merci de ton aide, sois indulgent, je débute en php...
    Quoi qu'il en soit, voici donc mon code...

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
    253
    254
    255
    256
    257
    258
    259
    260
    261
    262
    263
    264
    265
    266
    267
    268
    269
    270
    271
    272
    273
    274
    275
    276
    277
    278
    279
    280
    281
    282
    283
    284
    285
    286
    287
    288
    289
    290
    291
    292
    293
    294
    295
    296
    297
    298
    299
    300
    301
    302
    303
    304
    305
    306
    307
    308
    309
    310
    311
    312
    313
    314
    315
    316
    317
    318
    319
    320
    321
    322
    323
    324
    325
    326
    327
    328
    329
    330
    331
    332
    333
    334
    335
    336
    337
    338
    339
    340
    341
    342
    343
    344
    345
    346
    347
    348
    349
    350
    <?php require_once('../Connections/ProgFacture.php'); ?><?php
    function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") 
    {
      $theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue;
     
      switch ($theType) {
        case "text":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;    
        case "long":
        case "int":
          $theValue = ($theValue != "") ? intval($theValue) : "NULL";
          break;
        case "double":
          $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
          break;
        case "date":
          $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
          break;
        case "defined":
          $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
          break;
      }
      return $theValue;
    }
     
    $editFormAction = $_SERVER['PHP_SELF'];
    if (isset($_SERVER['QUERY_STRING'])) {
      $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
    }
     
    if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "form2")) {
      $insertSQL = sprintf("INSERT INTO devis (DevisId, ClientId, DevisDate, DevisType) VALUES (%s, %s, %s, %s)",
                           GetSQLValueString($_POST['DevisId'], "int"),
                           GetSQLValueString($_POST['ClientId'], "int"),
                           GetSQLValueString($_POST['DevisDate'], "date"),
    					   GetSQLValueString($_POST['DevisType'], "text"));
     
      mysql_select_db($database_ProgFacture, $ProgFacture);
      $Result1 = mysql_query($insertSQL, $ProgFacture) or die(mysql_error());
    	$id_recupere = $_POST['DevisId'];
      $insertGoTo = "CreationDevis.php?recordID2=".$id_recupere;
      if (isset($_SERVER['QUERY_STRING'])) {
        $insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
        $insertGoTo .= $_SERVER['QUERY_STRING'];
      }
      header(sprintf("Location: %s", $insertGoTo));
    }
     
    $colname_rsinfoClient = "-1";
    if (isset($_GET['recordID'])) {
      $colname_rsinfoClient = (get_magic_quotes_gpc()) ? $_GET['recordID'] : addslashes($_GET['recordID']);
    }
    mysql_select_db($database_ProgFacture, $ProgFacture);
    $query_rsinfoClient = sprintf("SELECT * FROM client WHERE ClientId = %s", $colname_rsinfoClient);
    $rsinfoClient = mysql_query($query_rsinfoClient, $ProgFacture) or die(mysql_error());
    $row_rsinfoClient = mysql_fetch_assoc($rsinfoClient);
    $totalRows_rsinfoClient = mysql_num_rows($rsinfoClient);
     
    $maxRows_rsDevis = 5;
    $pageNum_rsDevis = 0;
    if (isset($_GET['pageNum_rsDevis'])) {
      $pageNum_rsDevis = $_GET['pageNum_rsDevis'];
    }
    $startRow_rsDevis = $pageNum_rsDevis * $maxRows_rsDevis;
     
    $colname_rsDevis = "-1";
    if (isset($_GET['recordID'])) {
      $colname_rsDevis = (get_magic_quotes_gpc()) ? $_GET['recordID'] : addslashes($_GET['recordID']);
    }
    mysql_select_db($database_ProgFacture, $ProgFacture);
    $query_rsDevis = sprintf("SELECT * FROM devis WHERE DevisType = 'Devis' AND ClientId = %s ORDER by DevisId DESC", $colname_rsDevis);
    $query_limit_rsDevis = sprintf("%s LIMIT %d, %d", $query_rsDevis, $startRow_rsDevis, $maxRows_rsDevis);
    $rsDevis = mysql_query($query_limit_rsDevis, $ProgFacture) or die(mysql_error());
    $row_rsDevis = mysql_fetch_assoc($rsDevis);
     
    if (isset($_GET['totalRows_rsDevis'])) {
      $totalRows_rsDevis = $_GET['totalRows_rsDevis'];
    } else {
      $all_rsDevis = mysql_query($query_rsDevis);
      $totalRows_rsDevis = mysql_num_rows($all_rsDevis);
    }
    $totalPages_rsDevis = ceil($totalRows_rsDevis/$maxRows_rsDevis)-1;
     
    $colname_rsFacture = "-1";
    if (isset($GET['recordID'])) {
      $colname_rsFacture = (get_magic_quotes_gpc()) ? $GET['recordID'] : addslashes($GET['recordID']);
    }
    mysql_select_db($database_ProgFacture, $ProgFacture);
    $query_rsFacture = sprintf("SELECT * FROM devis WHERE DevisType = 'Facture' AND DevisId = %s ORDER BY DevisId DESC", $colname_rsFacture);
    $rsFacture = mysql_query($query_rsFacture, $ProgFacture) or die(mysql_error());
    $row_rsFacture = mysql_fetch_assoc($rsFacture);
    $totalRows_rsFacture = mysql_num_rows($rsFacture);
     
    //récuperation du numéro de facture le plus élevé//
    mysql_select_db($database_ProgFacture, $ProgFacture);
    $query_rsMaxDevis = "SELECT MAX(DevisId) AS nbre FROM devis";
    $rsMaxDevis = mysql_query($query_rsMaxDevis, $ProgFacture) or die(mysql_error());
    $row_rsMaxDevis = mysql_fetch_assoc($rsMaxDevis);
    $totalRows_rsMaxDevis = mysql_num_rows($rsMaxDevis);
     
     
    ?>
    <html>
    <head>
    <title>Fac</title>
    <body>
    <table width="95%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
      <tr>
        <td colspan="2" bgcolor="#00009C"><table width="800" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td height="30" background="/ps4000 2007/Image/FondDossier2.jpg"><table width="800" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <th width="245" scope="col">Client</th>
                <th width="256" scope="col">Documents</th>
                <th width="242" scope="col">Admin</th>
                <th width="57" scope="col">&nbsp;</th>
              </tr>
            </table></td>
          </tr>
        </table></td>
      </tr>
      <tr>
        <td colspan="2" bgcolor="#FFFFFF">&nbsp;</td>
      </tr>
      <tr>
        <td width="21%" valign="top"><table width="200" border="0" cellspacing="2" cellpadding="1">
     
          <tr>
            <td bgcolor="#FFFFFF">&nbsp;</td>
            <td bgcolor="#000099"><a href="/ps4000 2007/Client/RechercheClient.php">Rechercher un autre client </a></td>
            <td bgcolor="#FFFFFF">&nbsp;</td>
          </tr>
          <tr>
            <td bgcolor="#FFFFFF">&nbsp;</td>
            <td bgcolor="#000099"><a href="../Client/ModifierClient.php?recordID=<?php echo $row_rsinfoClient['ClientId']; ?>" class="Style3">Modifier les donn&eacute;es de ce client.</a></td>
            <td bgcolor="#FFFFFF">&nbsp;</td>
          </tr>
     
          <tr>
            <td bgcolor="#FFFFFF">&nbsp;</td>
            <td bgcolor="#000099"><span class="Style6"><a href="javascript:history.back()">&lt;&lt; Retour </a></span></td>
            <td bgcolor="#FFFFFF">&nbsp;</td>
          </tr>
          <tr>
            <td bgcolor="#FFFFFF">&nbsp;</td>
            <td bgcolor="#000099"><div align="center">
              <form name="form2" method="POST" action="<?php echo $editFormAction; ?>">
                <span class="Style10">
                <input name="DevisNom2" type="hidden" id="DevisNom2" value="<?php echo $row_rsinfoClient['ClientNom']; ?>" />
                <input name="ClientId" type="hidden" id="ClientId" value="<?php echo $row_rsinfoClient['ClientId']; ?>" size="8" />
                <input name="DevisType" type="hidden" id="DevisType" value="Devis" size="8" />
    <br />
    <input name="DevisDate" type="Hidden" id="DevisDate" value="<? echo date("Y-m-d") ?>" />
    <input type="text" name="DevisId" id="DevisId" value="<?php $max = $row_rsMaxDevis['nbre'];
    									  $maxOne = $max+1;
    									  echo $maxOne; ?>">
                </span>
                                  <input type="submit" name="Submit2" value="Creer New Doc">
                                  <input type="hidden" name="MM_insert" value="form2">
              </form>
              </div></td>
            <td bgcolor="#FFFFFF">&nbsp;</td>
          </tr>
          <tr>
            <td bgcolor="#FFFFFF">&nbsp;</td>
            <td bgcolor="#000099"><div align="center"></div></td>
            <td bgcolor="#FFFFFF">&nbsp;</td>
          </tr>
        </table></td>
        <td width="79%" valign="top"><div align="center">
          <form name="form1" method="post" action="">
            <table width="100%" border="0" cellspacing="0" cellpadding="1">
              <tr>
                <th valign="middle" bgcolor="#000000" scope="col"><div align="left">
                    <p class="Style9 Style7"><strong>Documents de
                      <input type="hidden" value="<?php echo $row_rsinfoClient['ClientId']; ?>" id="ClientId" name="ClientId" />
                          <?php echo $row_rsinfoClient['ClientTitre']; ?> <?php echo $row_rsinfoClient['ClientNom']; ?> <?php echo $row_rsinfoClient['ClientPrenom']; ?></strong></p>
                </div></th>
                <th scope="col">&nbsp;</th>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td>&nbsp;
                    <?php if($totalRows_rsDevis){?>
                  <table width="300" border="1" cellpadding="0" cellspacing="0">
                      <tr>
                        <td colspan="4" bgcolor="#000000"><span class="Style12">Nombre de Devis:<?php echo $totalRows_rsDevis; ?> </span></td>
                      </tr>
                      <tr>
                        <td bgcolor="#000000"><div align="center"><span class="Style7">Num&eacute;ro:</span></div></td>
                        <td colspan="3" bgcolor="#000000"><div align="center"><span class="Style7">Date:</span></div></td>
                      </tr>
                      <?php do { ?>
                      <tr>
                        <td><table width="100%" border="0" cellspacing="0" cellpadding="3">
                          <tr>
                            <td>DEV
                              <?php 
    $nbr = $row_rsDevis['DevisId'];
    $nbr = sprintf( "%04d", $nbr );
      echo $nbr; // affiche 0000
     ?>
                              <?php echo $row_rsinfoClient['ClientNom']; ?>:
                              <?
    $dateEn = $row_rsDevis['DevisDate'];
    $annee = substr($dateEn,2,2);
    $mois = substr($dateEn,5,2);
    echo $mois;
    echo $annee;
    ?>
                              <input type="hidden" name="DevisId" value="<?php echo $row_rsDevis['DevisId']; ?>"></td>
                          </tr>
                        </table></td>
                        <td><table width="100%" border="0" cellspacing="0" cellpadding="3">
                          <tr>
                            <td><?
    $dateEn = $row_rsDevis['DevisDate'];
    list($jour, $mois, $annee) = explode("-",$dateEn);
    $array = array($annee,$mois,$jour);
    $dateFr = implode("/",$array);
    echo $dateFr;
    ?></td>
                          </tr>
                        </table></td>
                        <td bgcolor="#00009C"><div align="center">
                          <table width="100%" border="0" cellspacing="0" cellpadding="3">
                            <tr>
                              <td><a href="DevisPrevisualisation.php?recordID=<?php echo $row_rsDevis['ClientId']; ?>&recordID2=<?php echo $row_rsDevis['DevisId']; ?>"><strong>V</strong></a></td>
                              </tr>
                          </table>
                        </div></td>
                        <td bgcolor="#FF0000"><div align="center">
                          <table width="100%" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                              <td><div align="center"><a href="DeleteDevis.php?recordID=<?php echo $row_rsinfoClient['ClientId']; ?>&recordID2=<?php echo $row_rsDevis['DevisId']; ?>" class="Style16"><strong>X</strong></a></div></td>
                            </tr>
                          </table>
                        </div></td>
                      </tr>
                      <?php } while ($row_rsDevis = mysql_fetch_assoc($rsDevis)); ?>
                    </table>
                  <?php }
    	  else {?>
                    <table width="300" border="1" cellpadding="0" cellspacing="0" bgcolor="#000000">
                      <tr>
                        <td><table width="300" border="0" cellspacing="0" cellpadding="2">
                            <tr>
                              <td><div align="center"><strong><span class="Style7">Aucun devis en attente. </span></strong></div></td>
                            </tr>
                        </table></td>
                      </tr>
                    </table>
                  <? }?></td>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td>&nbsp;</td>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td><?php if($totalRows_rsFacture){?>
                    <table width="300" border="1" cellpadding="0" cellspacing="0">
                      <tr>
                        <td colspan="3" bgcolor="#000000"><span class="Style7"></span><span class="Style7">Nombre de Facture:<?php echo $totalRows_rsFacture; ?> </span></td>
                      </tr>
                      <tr>
                        <td bgcolor="#000000"><div align="center"><span class="Style7">Num&eacute;ro:</span></div></td>
                        <td colspan="2" bgcolor="#000000"><div align="center"><span class="Style7">Date:</span></div></td>
                      </tr>
                      <?php do { ?>
                      <tr>
                        <td><table width="100%" border="0" cellspacing="0" cellpadding="3">
                          <tr>
                            <td>FAC
                              <?php 
    $nbr = $row_rsFacture['DevisNumber'];
    $nbr = sprintf( "%04d", $nbr );
      echo $nbr; // affiche 0000
     ?>
                              <?php echo $row_rsinfoClient['ClientNom']; ?>:
                              <?
    $dateEn = $row_rsFacture['DevisDate'];
    $annee = substr($dateEn,2,2);
    $mois = substr($dateEn,5,2);
    echo $mois;
    echo $annee;
    ?>
                              <input type="hidden" name="DevisId2" value="<?php echo $row_rsFacture['DevisId']; ?>"></td>
                          </tr>
                        </table></td>
                        <td><table width="100%" border="0" cellspacing="0" cellpadding="3">
                          <tr>
                            <td><?
    $dateEn = $row_rsFacture['DevisDate'];
    list($jour, $mois, $annee) = explode("-",$dateEn);
    $array = array($annee,$mois,$jour);
    $dateFr = implode("/",$array);
    echo $dateFr;
    ?></td>
                          </tr>
                        </table></td>
                        <td bgcolor="#00009C"><div align="center">
                          <table width="100%" border="0" cellspacing="0" cellpadding="3">
                            <tr>
                              <td><div align="center"><a href="DevisPrevisualisation.php?recordID=<?php echo $row_rsFacture['ClientId']; ?>&recordID2=<?php echo $row_rsFacture['DevisId']; ?>"><strong>V</strong></a></div></td>
                            </tr>
                          </table>
                        </div></td>
                      </tr>
                      <?php } while ($row_rsFacture = mysql_fetch_assoc($rsDevis)); ?>
                    </table>
                  <?php }
    	  else {?>
                    <table width="300" border="1" cellpadding="0" cellspacing="0" bgcolor="#000000">
                      <tr>
                        <td><table width="300" border="0" cellspacing="0" cellpadding="2">
                            <tr>
                              <td><div align="center"><strong><span class="Style7">Aucune Facture . </span></strong></div></td>
                            </tr>
                        </table></td>
                      </tr>
                    </table>
                  <? }?></td>
                <td>&nbsp;</td>
              </tr>
              <tr>
                <td><div align="right"></div></td>
                <td>&nbsp;</td>
              </tr>
            </table>
                </form>
          </div></td>
      </tr>
      <tr>
        <td colspan="2">&nbsp;</td>
      </tr>
    </table>
    </body>
    </html>
    <?php
    mysql_free_result($rsinfoClient);
     
    mysql_free_result($rsDevis);
     
    mysql_free_result($rsFacture);
    ?>

  4. #4
    Membre expert
    Homme Profil pro
    Architecte de système d'information
    Inscrit en
    Juillet 2004
    Messages
    2 725
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 37
    Localisation : France, Sarthe (Pays de la Loire)

    Informations professionnelles :
    Activité : Architecte de système d'information

    Informations forums :
    Inscription : Juillet 2004
    Messages : 2 725
    Points : 3 338
    Points
    3 338
    Par défaut
    Pffff c'est du code dreamweaver ca! C'est vraiment le bazard la dedans comment tu veut bosser avec ca...
    Par pitié !!!! :Si vous ne savez pas faire cliquez ici !
    Citation Envoyé par Marc-L
    C'est dommage que parfois tu sois aussi lourd que tu as l'air intelligent…

  5. #5
    Membre du Club
    Profil pro
    Inscrit en
    Décembre 2006
    Messages
    100
    Détails du profil
    Informations personnelles :
    Âge : 49
    Localisation : Belgique

    Informations forums :
    Inscription : Décembre 2006
    Messages : 100
    Points : 54
    Points
    54
    Par défaut
    En partie, oui c'est vrai...
    Mais sans meme parler du code, a partir du moment ou j'envoie une variable via url vers une page x, comment se fait il qu'ensuite,en allant de cette page x vers une page y, l'url transporte encore ces variables, alors que je ne les demande pas??? Et y a t'il moyen d'arreter cela?

  6. #6
    Membre expert
    Homme Profil pro
    Architecte de système d'information
    Inscrit en
    Juillet 2004
    Messages
    2 725
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 37
    Localisation : France, Sarthe (Pays de la Loire)

    Informations professionnelles :
    Activité : Architecte de système d'information

    Informations forums :
    Inscription : Juillet 2004
    Messages : 2 725
    Points : 3 338
    Points
    3 338
    Par défaut
    Ca doit etre dans l'appel de ta page...
    Par pitié !!!! :Si vous ne savez pas faire cliquez ici !
    Citation Envoyé par Marc-L
    C'est dommage que parfois tu sois aussi lourd que tu as l'air intelligent…

  7. #7
    Expert éminent sénior

    Profil pro
    Inscrit en
    Juin 2002
    Messages
    6 152
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Juin 2002
    Messages : 6 152
    Points : 17 778
    Points
    17 778
    Par défaut
    Citation Envoyé par godjojo
    Mais sans même parler du code, a partir du moment ou j'envoie une variable via url vers une page x, comment se fait il qu'ensuite,en allant de cette page x vers une page y, l'url transporte encore ces variables, alors que je ne les demande pas??? Et y a t'il moyen d'arrêter cela?
    C'est parce que vous utilisez $_SERVER['QUERY_STRING'] ...

    Si vous souhaitez retransmettre les mêmes variables mais après les avoir modifiées :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    $_GET['X'] = 'Y';
    header('Location: AfficherDocument.php' . http_build_query($_GET));
    (http_build_query est une fonction PHP 5, vous trouverez dans sa documentation une réimplémentation parmi les commentaires).

    Sinon construisez votre requête sans passer par $_SERVER['QUERY_STRING'] :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    header('Location: AfficherDocument.php?param1=valeur1&param2=valeur2');

  8. #8
    Membre du Club
    Profil pro
    Inscrit en
    Décembre 2006
    Messages
    100
    Détails du profil
    Informations personnelles :
    Âge : 49
    Localisation : Belgique

    Informations forums :
    Inscription : Décembre 2006
    Messages : 100
    Points : 54
    Points
    54
    Par défaut
    Merci à vous pour votre aide...
    je vais aller voir par la...
    Un grand merci....

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Variable persistante (bash, sed)
    Par fransoo dans le forum Shell et commandes GNU
    Réponses: 12
    Dernier message: 19/02/2017, 21h53
  2. Réponses: 2
    Dernier message: 16/08/2010, 14h46
  3. Requete date variable formulaire
    Par imsse dans le forum Requêtes et SQL.
    Réponses: 17
    Dernier message: 09/04/2008, 11h34
  4. [Dates] Ignore_user_abort : comment arrêter ?
    Par phicarre dans le forum Langage
    Réponses: 5
    Dernier message: 17/03/2008, 15h55
  5. Date variable dans SQL server 2005 anglais
    Par denisr dans le forum MS SQL Server
    Réponses: 1
    Dernier message: 15/06/2007, 11h19

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo