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 :

Perte de valeur de session après 2e formulaire


Sujet :

Langage PHP

  1. #1
    Membre expérimenté
    Avatar de jbrasselet
    Homme Profil pro
    Chef de projet NTIC
    Inscrit en
    Mars 2006
    Messages
    1 022
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 45
    Localisation : France, Ille et Vilaine (Bretagne)

    Informations professionnelles :
    Activité : Chef de projet NTIC
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Mars 2006
    Messages : 1 022
    Points : 1 413
    Points
    1 413
    Par défaut Perte de valeur de session après 2e formulaire
    Bonjour,

    je dois être aveugle aujourd'hui mais voici mon problème.

    J'ai un premier formulaire appelé c_devis1.php dont voici le 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
     
    <?php
    session_start();
    include("g_connexion.php");
    include("g_fonctions.php");
    include("g_fonctions_interface.php");
     
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
    	<head>
          <?php
          afficherHead();
          ajouterJs("g_fonctions.js");
          ajouterJs("g_calendrier.js");
          ajouterCss("styleCalendrier.css");
          ?>
    	</head>
    	<body>
    	<div id="main">
    		<div id='banniere'>
             <img class='banniereImg' src='./images/banniere.gif' alt="Festiv-Picard : Location de chapiteau" />
          </div>
          <div id='stats'>
             <div class="statsGauche">
                <?php
                afficherMenu();
                ?>
             </div>
          </div>
          <div id="cadre">
             <div class="pageTitle"><br />Demande de devis (1/3) - Informations personnelles<br /></div>
             <div class="pageContent">
                <span class="txtNormal12">
                   <form id='formulaire' action='c_devis2.php' method='post' onsubmit="return verifierFormulaireDevisContact();">
                   <table width="1010px">
                      <tr>
                         <!-- NOM -->
                         <td width="200px"><span id="spanNom" class="infoObligatoire">Nom</span></td>
                         <td width="300px"><input type="text" size="30" id="txtNom" name="txtNom" class="infoObligatoire" value="" onblur="testerChamp('Nom');" onkeypress="return verifierLettre(event, this.id);" tabindex="1" /> *</td>
                         <td>&nbsp;</td>
                         <td width="200px">&nbsp;</td>
                         <td width="300px">&nbsp;</td>
                      </tr>
                      <tr>
                         <!-- PRENOM -->
                         <td><span id="spanPrenom" class="infoObligatoire">Prénom</span></td>
                         <td><input type="text" size="30" id="txtPrenom" name="txtPrenom" class="infoObligatoire" value="" onblur="testerChamp('Prenom');" onkeypress="return verifierLettre(event, this.id);" tabindex="2" /> *</td>
                         <td colspan="3">&nbsp;</td>
                      </tr>
                      <tr>
                         <!-- EMAIL -->
                         <td><span id="spanEmail" class="infoObligatoire">Adresse e-mail</span></td>
                         <td><input type="text" size="30" id="txtEmail" name="txtEmail" class="infoObligatoire" value="" onblur="testerChamp('Email');verifierEmail('Email');" tabindex="3" /> *</td>
                         <td colspan="3">&nbsp;</td>
                      </tr>
                      <tr>
                         <!-- CONFIRMATION EMAIL -->
                         <td><span id="spanEmail2" class="infoObligatoire">Confirmation</span></td>
                         <td><input type="text" size="30" id="txtEmail2" name="txtEmail2" class="infoObligatoire" value="" onblur="testerChamp('Email2');verifierEmail('Email2');" tabindex="4" /> *</td>
                         <td colspan="3">&nbsp;</td>
                      </tr>
                      <tr>
                         <!-- TELEPHONE -->
                         <td><span id="spanTelephone" class="infoObligatoire">Téléphone (XX.XX.XX.XX.XX)</span></td>
                         <td><input type="text" size="30" maxlength="10" id="txtTelephone" name="txtTelephone" class="infoOK" value="" onclick="presenterTelephone(this);" onblur="testerChamp('Telephone');formaterTelephone(this);" onkeypress="return verifierNombre(event);" tabindex="5" /> *</td>
                         <td colspan="3">&nbsp;</td>
                      </tr>
                      <tr>
                         <td colspan="5"><hr /></td>
                      </tr>
                      <tr>
                         <td colspan="2"><b>Adresse de facturation</b></td>
                         <td>&nbsp;</td>
                         <td colspan="2"><b>Adresse de location</b></td>
                      </tr>
                      <tr>
                         <!-- NOM RUE -->
                         <td><span id="spanRueF" class="infoObligatoire">Numéro, rue</span></td>
                         <td><input type="text" size="30" id="txtRueF" name="txtRueF" class="infoOK" value="" onblur="testerChamp('RueF');" tabindex="6" /> *</td>
                         <td>&nbsp;</td>
                         <!-- NOM RUE -->
                         <td><span id="spanRueL" class="infoObligatoire">Numéro, rue</span></td>
                         <td><input type="text" size="30" id="txtRueL" name="txtRueL" class="infoOK" value="" onblur="testerChamp('RueL');" tabindex="10" /> *</td>
                      </tr>
                      <tr>
                         <!-- CODE POSTAL -->
                         <td><span id="spanCPF" class="infoObligatoire">Code postal</span></td>
                         <td><input type="text" size="30" maxlength="5" id="txtCPF" name="txtCPF" class="infoOK" value="" onblur="testerChamp('CPF');" onkeypress="return verifierNombre(event)" tabindex="7" /> *</td>
                         <td>&nbsp;</td>
                         <!-- CODE POSTAL -->
                         <td><span id="spanCPL" class="infoObligatoire">Code postal</span></td>
                         <td><input type="text" size="30" maxlength="5" id="txtCPL" name="txtCPL" class="infoOK" value="" onblur="testerChamp('CPL');" onkeypress="return verifierNombre(event)" tabindex="11" /> *</td>
                      </tr>
                      <tr>
                         <!-- VILLE -->
                         <td><span id="spanVilleF" class="infoObligatoire">Ville</span></td>
                         <td><input type="text" size="30" id="txtVilleF" name="txtVilleF" class="infoOK" value="" onblur="testerChamp('VilleF');" onkeypress="return verifierLettre(event, this.id);" tabindex="8" /> *</td>
                         <td>&nbsp;</td>
                         <!-- VILLE -->
                         <td><span id="spanVilleL" class="infoObligatoire">Ville</span></td>
                         <td><input type="text" size="30" id="txtVilleL" name="txtVilleL" class="infoOK" value="" onblur="testerChamp('VilleL');" onkeypress="return verifierLettre(event, this.id);" tabindex="12" /> *</td>
                      </tr>
                      <tr>
                         <td colspan="5"><input type="checkbox" id="chkAdresse" onclick="remplirAdresseLivraison(this)" tabindex="9" />Cochez si l'adresse de location est la même que l'adresse de facturation.</td>
                      </tr>
                      <tr>
                         <td colspan="5"><hr /></td>
                      </tr>
                      <tr>
                         <!-- DATE LOCATION -->
                         <td><span id="spanDate" class="infoObligatoire">Daté prévue de location</span></td>
                         <td><input type="text" size="30" id="txtDate" name="txtDate" class="infoObligatoire" value="" onblur="testerChamp('Date');" onclick="var toto = new calendar(this);" tabindex="13" /> *</td>
                         <td colspan="3">&nbsp;</td>
                      </tr>
                      <tr>
                         <td colspan="5">&nbsp;</td>
                      </tr>
                      <tr>
                         <td colspan="5">&nbsp;</td>
                      </tr>
                      <tr>
                         <td colspan="5">&nbsp;</td>
                      </tr>
                      <tr>
                         <td colspan="5">&nbsp;</td>
                      </tr>
                      <tr>
                         <td colspan="5">&nbsp;</td>
                      </tr>
                      <tr>
                         <td colspan="5">&nbsp;</td>
                      </tr>
                      <tr>
                         <td colspan="5">&nbsp;</td>
                      </tr>
                      <tr>
                         <td colspan="5">&nbsp;</td>
                      </tr>
                      <tr>
                         <td colspan="5">&nbsp;</td>
                      </tr>
                      <tr>
                         <td colspan="4">* = informations obligatoires</td>
                         <td colspan="1" class="tdBoutondroit"><input type="submit" name="Envoyer" value="Etape suivante" class="btnDroite" tabindex="14"></td>
                      </tr>
                   </table>
                   </form>
                <br />
                </span>
             </div>
          </div>
          <div id="copyright">
             <?php
             afficherCopyrigth();
             ?>
         </div>
       </div>
    	</body>
    </html>
    Cette page appelle donc une page c_devis2.php qui enregistre en session les variables de mon premier formulaire
    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
     
    <?php
    session_start();
    include("g_connexion.php");
    include("g_fonctions.php");
    include("g_fonctions_interface.php");
     
    $result = "";
    if (!isset($_POST['txtNom'])) {
       header('Location: c_devis1.php');
    }
    $_SESSION['txtNom'] = $_POST['txtNom'];
    $_SESSION['txtPrenom'] = $_POST['txtPrenom'];
    $_SESSION['txtEmail'] = $_POST['txtEmail'];
    $_SESSION['txtTelephone'] = $_POST['txtTelephone'];
    $_SESSION['txtRueF'] = $_POST['txtRueF'];
    $_SESSION['txtCPF'] = $_POST['txtCPF'];
    $_SESSION['txtVilleF'] = $_POST['txtVilleF'];
    $_SESSION['txtRueL'] = $_POST['txtRueL'];
    $_SESSION['txtCPL'] = $_POST['txtCPL'];
    $_SESSION['txtVilleL'] = $_POST['txtVilleL'];
    $_SESSION['txtDate'] = $_POST['txtDate'];
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
    	<head>
          <?php
          afficherHead();
          ajouterJs("g_fonctions.js");
          ?>
    	</head>
    	<body onload="choisirSolution('1');">
    	<div id="main">
    		<div id='banniere'>
             <img class='banniereImg' src='./images/banniere.gif' alt="Festiv-Picard : Location de chapiteau" />
          </div>
          <div id='stats'>
             <div class="statsGauche">
                <?php
                afficherMenu();
                ?>
             </div>
          </div>
          <div id="cadre">
             <div class="pageTitle"><br />Demande de devis (2/3) - Détail de la prestation<br /></div>
             <div class="pageContent">
                <span class="txtNormal12">
                   <form id='formulaire' action='c_devis3.php' method='post' onsubmit="return verifierFormulaireDevisPrestation();">
                      <table width="1010px">
                         <tr>
                         <?php echo session_id(); ?>
                            <!-- PACK1 -->
                            <td colspan="5">
                               <input type="radio" id="rad_pack1" name="choix_pack" onclick="choisirSolution('1');" checked tabindex="1" /> Solution Festiv-Picard tout-en-un 40 personnes / 48H
                            </td>
                         </tr>
                         <!--
                         <tr>
                            PACK2 
                            <td colspan="5">
                               <input type="radio" id="rad_pack2" name="choix_pack" onclick="toggleAlert(true);choisirSolution('2');" /> Solution Festiv-Picard tout-en-un 80 personnes
                            </td>
                         </tr>
                         -->
                         <tr>
                            <!-- PERSONNALISE -->
                            <td colspan="5">
                               <input type="radio" id="rad_parso" name="choix_pack" onclick="choisirSolution('3');" tabindex="3" /> Solution Personnalisée
                            </td>
                         </tr>
                      </table>
                      <hr />
                      <div id="divTableDevis">
                         <table class="devis">
                            <tr>
                               <td colspan="3"> Taille du chapiteau :
                                              <select id="taille" onchange="calculerPrixChapiteau();" tabindex="5" >
                                                 <option>40 m²</option>
                                                 <option>80 m²</option>
                                                 <option>120 m²</option>
                                                 <option>160 m²</option>
                                              </select>
                               </td>
                               <td colspan="3"> Durée de location :
                                              <select id="duree" onchange="calculerPrixChapiteau();" tabindex="6" >
                                                 <option>48H</option>
                                                 <option>72H</option>
                                              </select>
                               </td>
                               <td colspan="2"><b>Total Chapiteau</b></td>
                               <td><input type="text" size="5" id="stotChapiteau" value="0" disabled /></td>
                               <td>&nbsp;</td>
                            </tr>
                            <tr>
                               <!-- TABLE -->
                               <td>Tables</td>
                               <td><input type="text" size="5" id="tarTable" value="3.50 €" disabled /></td>
                               <td><input type="text" size="5" id="qteTable" value="0" onblur="calculerPrix(this.id);" tabindex="10" /></td>
                               <td><input type="text" size="5" id="totTable" value="0" disabled /></td>
                               <td>&nbsp;</td>
                               <!-- CHAISE -->
                               <td>Chaises</td>
                               <td><input type="text" size="5" id="tarChaise" value="1.20 €" disabled /></td>
                               <td><input type="text" size="5" id="qteChaise" value="0" onblur="calculerPrix(this.id);" tabindex="11" /></td>
                               <td><input type="text" size="5" id="totChaise" value="0" disabled /></td>
                               <td>&nbsp;</td>
                            </tr>
                            <tr>
                               <td colspan="6">&nbsp;</td>
                               <td colspan="2"><b>Total Tables et Chaises</b></td>
                               <td><input type="text" size="5" id="stotTableEtChaise" value="0" disabled /></td>
                               <td>&nbsp;</td>
                            </tr>
                            <tr>
                               <!-- ASSIETTES PLATES -->
                               <td>Assiettes Plates 24cm</td>
                               <td><input type="text" size="5" id="tarAssiettePlate" value="0.30 €" disabled /></td>
                               <td><input type="text" size="5" id="qteAssiettePlate" value="0" onblur="calculerPrix(this.id);" tabindex="12" /></td>
                               <td><input type="text" size="5" id="totAssiettePlate" value="0" disabled /></td>
                               <td>&nbsp;</td>
                               <!-- CUILLIERES DE TABLE -->
                               <td>Cuillières à soupe</td>
                               <td><input type="text" size="5" id="tarCuilliere" value="0.15 €" disabled /></td>
                               <td><input type="text" size="5" id="qteCuilliere" value="0" onblur="calculerPrix(this.id);" tabindex="23" /></td>
                               <td><input type="text" size="5" id="totCuilliere" value="0" disabled /></td>
                               <td>&nbsp;</td>
                            </tr>
                            <tr>
                               <!-- ASSIETTES DESSERT -->
                               <td>Assiettes Dessert 16,8cm</td>
                               <td><input type="text" size="5" id="tarAssietteDessert" value="0.30 €" disabled /></td>
                               <td><input type="text" size="5" id="qteAssietteDessert" value="0" onblur="calculerPrix(this.id);" tabindex="13" /></td>
                               <td><input type="text" size="5" id="totAssietteDessert" value="0" disabled /></td>
                               <td>&nbsp;</td>
                               <!-- CUILLIERES DE TABLE -->
                               <td>Cuillières à café</td>
                               <td><input type="text" size="5" id="tarCuilliereCafe" value="0.15 €" disabled /></td>
                               <td><input type="text" size="5" id="qteCuilliereCafe" value="0" onblur="calculerPrix(this.id);" tabindex="24" /></td>
                               <td><input type="text" size="5" id="totCuilliereCafe" value="0" disabled /></td>
                               <td>&nbsp;</td>
                            </tr>
                            <tr>
                               <!-- ASSIETTES -->
                               <td>Assiettes 19cm</td>
                               <td><input type="text" size="5" id="tarAssiette" value="0.30 €" disabled /></td>
                               <td><input type="text" size="5" id="qteAssiette" value="0" onblur="calculerPrix(this.id);" tabindex="14" /></td>
                               <td><input type="text" size="5" id="totAssiette" value="0" disabled /></td>
                               <td>&nbsp;</td>
                               <!-- TASSES CAFE -->
                               <td>Tasses à café</td>
                               <td><input type="text" size="5" id="tarTasseCafe" value="0.30 €" disabled /></td>
                               <td><input type="text" size="5" id="qteTasseCafe" value="0" onblur="calculerPrix(this.id);" tabindex="25" /></td>
                               <td><input type="text" size="5" id="totTasseCafe" value="0" disabled /></td>
                               <td>&nbsp;</td>
                            </tr>
                            <tr>
                                <!-- VERRES APERO -->
                               <td>Verres à apéritif</td>
                               <td><input type="text" size="5" id="tarVerreAperitif" value="0.30 €" disabled /></td>
                               <td><input type="text" size="5" id="qteVerreAperitif" value="0" onblur="calculerPrix(this.id);" tabindex="15" /></td>
                               <td><input type="text" size="5" id="totVerreAperitif" value="0" disabled /></td>
                               <td>&nbsp;</td>
                               <!-- COUPE -->
                               <td>Coupe Pépite</td>
                               <td><input type="text" size="5" id="tarCoupePepite" value="0.30 €" disabled /></td>
                               <td><input type="text" size="5" id="qteCoupePepite" value="0" onblur="calculerPrix(this.id);" tabindex="26" /></td>
                               <td><input type="text" size="5" id="totCoupePepite" value="0" disabled /></td>
                               <td>&nbsp;</td>
                            </tr>
                            <tr>
                               <!-- VERRE PIED EAU -->
                               <td>Verre à pied 24,5cl</td>
                               <td><input type="text" size="5" id="tarVerreEau" value="0.30 €" disabled /></td>
                               <td><input type="text" size="5" id="qteVerreEau" value="0" onblur="calculerPrix(this.id);" tabindex="16" /></td>
                               <td><input type="text" size="5" id="totVerreEau" value="0" disabled /></td>
                               <td>&nbsp;</td>
                               <!-- CARAFE -->
                               <td>Carafe carrée 50cl</td>
                               <td><input type="text" size="5" id="tarCarafe" value="0.50 €" disabled /></td>
                               <td><input type="text" size="5" id="qteCarafe" value="0" onblur="calculerPrix(this.id);" tabindex="27" /></td>
                               <td><input type="text" size="5" id="totCarafe" value="0" disabled /></td>
                               <td>&nbsp;</td>
                            </tr>
                            <tr>
                               <!-- VERRE PIED VIN -->
                               <td>Verre à pied 19cl</td>
                               <td><input type="text" size="5" id="tarVerreVin" value="0.30 €" disabled /></td>
                               <td><input type="text" size="5" id="qteVerreVin" value="0" onblur="calculerPrix(this.id);" tabindex="17" /></td>
                               <td><input type="text" size="5" id="totVerreVin" value="0" disabled /></td>
                               <td>&nbsp;</td>
                               <!-- SUCRIER -->
                               <td>Sucrier boule</td>
                               <td><input type="text" size="5" id="tarSucrier" value="1 €" disabled /></td>
                               <td><input type="text" size="5" id="qteSucrier" value="0" onblur="calculerPrix(this.id);" tabindex="28" /></td>
                               <td><input type="text" size="5" id="totSucrier" value="0" disabled /></td>
                               <td>&nbsp;</td>
                            </tr>
                            <tr>
                               <!-- FLUTES -->
                               <td>Flutes à champagne 13cl</td>
                               <td><input type="text" size="5" id="tarFlute" value="0.30 €" disabled /></td>
                               <td><input type="text" size="5" id="qteFlute" value="0" onblur="calculerPrix(this.id);" tabindex="18" /></td>
                               <td><input type="text" size="5" id="totFlute" value="0" disabled /></td>
                               <td>&nbsp;</td>
                               <!-- MENAGERE -->
                               <td>Ménagère Sel et Poivre</td>
                               <td><input type="text" size="5" id="tarMenagere" value="0.50 €" disabled /></td>
                               <td><input type="text" size="5" id="qteMenagere" value="0" onblur="calculerPrix(this.id);" tabindex="29" /></td>
                               <td><input type="text" size="5" id="totMenagere" value="0" disabled /></td>
                               <td>&nbsp;</td>
                            </tr>
                            <tr>
                               <!-- VERRINES -->
                               <td>Verrines 6cl</td>
                               <td><input type="text" size="5" id="tarVerrine" value="0.30 €" disabled /></td>
                               <td><input type="text" size="5" id="qteVerrine" value="0" onblur="calculerPrix(this.id);" tabindex="19" /></td>
                               <td><input type="text" size="5" id="totVerrine" value="0" disabled /></td>
                               <td>&nbsp;</td>
                               <!-- CORBEILLE -->
                               <td>Corbeille à pain en inox</td>
                               <td><input type="text" size="5" id="tarCorbeille" value="0.45 €" disabled /></td>
                               <td><input type="text" size="5" id="qteCorbeille" value="0" onblur="calculerPrix(this.id);" tabindex="30" /></td>
                               <td><input type="text" size="5" id="totCorbeille" value="0" disabled /></td>
                               <td>&nbsp;</td>
                            </tr>
                            <tr>
                               <!-- FOURCHETTES -->
                               <td>Fourchettes de table</td>
                               <td><input type="text" size="5" id="tarFourchette" value="0.15 €" disabled /></td>
                               <td><input type="text" size="5" id="qteFourchette" value="0" onblur="calculerPrix(this.id);" tabindex="20" /></td>
                               <td><input type="text" size="5" id="totFourchette" value="0" disabled /></td>
                               <td>&nbsp;</td>
                               <!-- CAFETIERE -->
                               <td>Cafetière (~70 tasses)</td>
                               <td><input type="text" size="5" id="tarCafetiere" value="20.00 €" disabled /></td>
                               <td><input type="text" size="5" id="qteCafetiere" value="0" onblur="calculerPrix(this.id);" tabindex="31" /></td>
                               <td><input type="text" size="5" id="totCafetiere" value="0" disabled /></td>
                               <td>&nbsp;</td>
                            </tr>
                            <tr>
                               <!-- COUTEAU -->
                               <td>Couteaux de table</td>
                               <td><input type="text" size="5" id="tarCouteau" value="0.15 €" disabled /></td>
                               <td><input type="text" size="5" id="qteCouteau" value="0" onblur="calculerPrix(this.id);" tabindex="21" /></td>
                               <td><input type="text" size="5" id="totCouteau" value="0" disabled /></td>
                               <td>&nbsp;</td>
                               <!-- PRESENTOIR -->
                               <td>Présentoir buffet</td>
                               <td><input type="text" size="5" id="tarPresentoir" value="5.00 €" disabled /></td>
                               <td><input type="text" size="5" id="qtePresentoir" value="0" onblur="calculerPrix(this.id);" tabindex="32" /></td>
                               <td><input type="text" size="5" id="totPresentoir" value="0" disabled /></td>
                               <td>&nbsp;</td>
                            </tr>
                            <tr>
                               <!-- PAPILLON -->
                               <td>Papillon carton or (vente)</td>
                               <td><input type="text" size="5" id="tarPapillon" value="10.00 €" disabled /></td>
                               <td><input type="text" size="5" id="qtePapillon" value="0" onblur="calculerPrix(this.id);" tabindex="22" /></td>
                               <td><input type="text" size="5" id="totPapillon" value="0" disabled /></td>
                               <td>&nbsp;</td>
                               <!-- CARTE -->
                               <td>Coeur carton or (vente)</td>
                               <td><input type="text" size="5" id="tarCoeur" value="10.00 €" disabled /></td>
                               <td><input type="text" size="5" id="qteCoeur" value="0" onblur="calculerPrix(this.id);" tabindex="33" /></td>
                               <td><input type="text" size="5" id="totCoeur" value="0" disabled /></td>
                               <td>&nbsp;</td>
                            </tr>
                            <tr>
                               <td colspan="6">&nbsp;</td>
                               <td colspan="2"><b>Total Vaisselle</b></td>
                               <td><input type="text" size="5" id="stotVaisselle" value="0" disabled /></td>
                               <td>&nbsp;</td>
                            </tr>
                            <tr>
                               <td colspan="6">&nbsp;</td>
                               <td colspan="2"><b>Total TTC</b></td>
                               <td><input type="text" size="5" id="stotTotal" value="0" disabled /></td>
                               <td>&nbsp;</td>
                            </tr>
                         </table>
                      </div>
                      <table width="1010px">
                         <tr>
                            <td>&nbsp;</td>
                            <td class="tdBoutondroit" width="170px"><input type="submit" name="Envoyer" value="Etape suivante" class="btnDroite" tabindex="40"></td>
                         </tr>
                      </table>
                   </form>
                <br />
                </span>
             </div>
          </div>
          <div id="copyright">
             <?php
             afficherCopyrigth();
             ?>
         </div>
       </div>
    	</body>
    </html>
    Suite à la validation de ce second formulaire, une troisième page c_devis3.php est appelée.
    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
     
    <?php
    session_start();
    include("g_connexion.php");
    include("g_fonctions.php");
    include("g_fonctions_interface.php");
    include_once("g_antispam.php");
     
    $result = "";
     
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
    	<head>
          <?php
          afficherHead();
          ajouterJs("g_fonctions.js");
          ?>
    	</head>
    	<body>
    	<div id="main">
    		<div id='banniere'>
             <img class='banniereImg' src='./images/banniere.gif' alt="Festiv-Picard : Location de chapiteau" />
          </div>
          <div id='stats'>
             <div class="statsGauche">
                <?php
                afficherMenu();
                ?>
             </div>
          </div>
          <div id="cadre">
             <div class="pageTitle"><br />Demande de devis (3/3) - Commentaires<br /></div>
             <div class="pageContent">
                <span class="txtNormal12">
                   <form id='formulaire' action='c_devis3.php' method='post' onsubmit="return verifierFormulaireDevis();">
                   <table width="1010px">
                   <?php echo $_SESSION['txtNom']." / ".$_SESSION['txtTelephone']; ?>
                      <tr>
                         <!-- INFO COMPLEMENTAIRE -->
                         <td colspan="5"><span id="spanDemande" class="infoObligatoire">Informations complémentaires</span></td>
                      </tr>
                      <tr>
                         <td colspan="5"><textarea type="textarea" cols="120" rows="20" size="2500" id="txtDemande" name="txtDemande" onfocus="viderTxtDemande();" onblur="sortirTxtDemande();"  tabindex="18">Pour toutes questions ou remarques supplémentaires... </textarea></td>
                      </tr>
                      <tr>
                         <td colspan="5"><hr /></td>
                      </tr>
                      <tr>
                         <td colspan="5">Dispositif anti-spam : <?php antispam_ins(); echo "<span class='txtErreur'>".$result."</span>"; ?></td>
                      </tr>
                      <tr>
                         <td colspan="5">&nbsp;</td>
                      </tr>
                      <tr>
                         <td colspan="5">&nbsp;</td>
                      </tr>
                      <tr>
                         <td colspan="5">&nbsp;</td>
                      </tr>
                      <tr>
                         <td colspan="5">&nbsp;</td>
                      </tr>
                      <tr>
                         <td colspan="4">&nbsp;</td>
                         <td class="tdBoutondroit" width="170px"><input type="submit" name="Envoyer" value="Envoyer" class="btnDroite" tabindex="40"></td>
                      </tr>
                   </table>
                   </form>
                <br />
                </span>
             </div>
          </div>
          <div id="copyright">
             <?php
             afficherCopyrigth();
             ?>
         </div>
       </div>
    	</body>
    </html>
    Jusque là rien d'extraordinaire. Seulement, lorsque dans ma troisième page j'essaye d'afficher $_SESSION['txtNom'] il m'affiche blanc alors que dans la deuxième page il m'affiche correctement ma valeur !

    J'avoue que je ne comprend pas d'où cela peut venir
    Si j'affiche le session_id dans la page 2 et la page 3 j'obtiens bien le même...

    Merci d'avance

  2. #2
    Modérateur
    Avatar de sabotage
    Homme Profil pro
    Inscrit en
    Juillet 2005
    Messages
    29 208
    Détails du profil
    Informations personnelles :
    Sexe : Homme

    Informations forums :
    Inscription : Juillet 2005
    Messages : 29 208
    Points : 44 155
    Points
    44 155
    Par défaut
    J'ai testé tes 3 fichiers (sans les fonctions incluses) et j'ai bien le nom repris sur la 3ème page.

    Est-ce que cette donnée n'est pas modifiée par un des fichiers inclus justement ?

  3. #3
    Membre expérimenté
    Avatar de jbrasselet
    Homme Profil pro
    Chef de projet NTIC
    Inscrit en
    Mars 2006
    Messages
    1 022
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 45
    Localisation : France, Ille et Vilaine (Bretagne)

    Informations professionnelles :
    Activité : Chef de projet NTIC
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Mars 2006
    Messages : 1 022
    Points : 1 413
    Points
    1 413
    Par défaut
    En suivant ta piste, j'ai en effet découvert que cela ne fonctionnait pas à cause d'une ligne de mon entête :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    <link rel="shortcut icon" href="" />

    J'avoue ne pas très bien comprendre pourquoi le fait d'avoir oublié le nom de l'icone dans le href fait planter cela

    Enfin bref, merci beaucoup !

  4. #4
    Modérateur
    Avatar de sabotage
    Homme Profil pro
    Inscrit en
    Juillet 2005
    Messages
    29 208
    Détails du profil
    Informations personnelles :
    Sexe : Homme

    Informations forums :
    Inscription : Juillet 2005
    Messages : 29 208
    Points : 44 155
    Points
    44 155
    Par défaut
    Quand tu indiques "", certains navigateurs chargent la page courante.

    Je suppose donc que ton script s'executant une fois en reception du formulaire puis une nouvelle sans reception des données du formulaire (donc ta variable prenait la valeur de $_POST qui etait vide)

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

Discussions similaires

  1. demarré une session après un formulaire.
    Par cedcyr dans le forum Langage
    Réponses: 7
    Dernier message: 11/11/2013, 12h13
  2. Réponses: 6
    Dernier message: 04/06/2009, 21h47
  3. Perte de session après formulaire
    Par j0o0 dans le forum Langage
    Réponses: 9
    Dernier message: 09/05/2009, 22h22
  4. Perte de valeur de session
    Par lenstoi dans le forum Langage
    Réponses: 2
    Dernier message: 20/08/2007, 19h21
  5. Perte de valeur de paramètre entre 2 formulaires
    Par lodan dans le forum Langage
    Réponses: 4
    Dernier message: 23/09/2006, 10h13

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