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 :

header already sent


Sujet :

Langage PHP

  1. #1
    Futur Membre du Club
    Profil pro
    Inscrit en
    Janvier 2011
    Messages
    4
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Janvier 2011
    Messages : 4
    Points : 5
    Points
    5
    Par défaut header already sent
    Allô à vous tous et toutes.
    Je galère depuis 3 heures sur un fichier php.
    Je désire empêcher la soumission à répétition du contenu d'un formulaire suite au rafraîchissement (Refresh, F5, etc.) de la page par l'utilisateur.

    Suite à une recherche sur Internet, j'ai décidé d'utiliser la fonction header (Location: ssss.php)
    Le tout a marché un moment donné. Depuis, j'ai ajouté du code et maintenant, j'ai un message du genre :
    Warning: Cannot modify header information - headers already sent by (output started at

    J'ai essayé de trouver la source du problème (espaces, echo de data, etc). Je ne trouve rien. Pouvez-vous m'aider s.v.p.

    Voici le code du fichier
    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
    351
    352
    353
    354
    355
    356
    357
    358
    359
    360
     
    <!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" xml:lang="en" lang="en"> 
    <head>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
    <meta http-equiv="Content-Script-Type" content="text/javascript" />
    <title>Typology Calculator</title>
    <script type="text/javascript">
    <!--
    var q1 = 0;
    var q2 = 0;
    var q3 = 0;
    var q4 = 0;
    var q5 = 0;
    var q6 = 0;
    var q7 = 0;
    var q8 = 0;
    var q9 = 0;
    var q10 = 0;
    var q11 = 0;
    var q12 = 0;
    var q13 = 0;
    var q14 = 0;
    var q15 = 0;
    var q16 = 0;
    var q17 = 0;
    var nom="";
    var nopass=0;
    var radi = 30;
    var evidence = 0;
    var nonconformity =0;
    var practicality = 0;
    var typology = "";
    var currentDate = new Date();
    var day = currentDate.getDate();
    var month = currentDate.getMonth() + 1;
    var year = currentDate.getFullYear();
    var hours = currentDate.getHours();
    var minutes = currentDate.getMinutes();
    if (minutes < 10){ minutes = "0" + minutes};
    if (day < 10){ day = "0" + day};
    if (month < 10){ month = "0" + month};
    if (hours < 10){ hours = "0" + hours};
    var maintenant = day + "/" + month + "/" + year + ":" +  hours + ":" + minutes;
    function typo() {
    var evidence = q1+q3+q9+q12+q16+q17;
    var nonconformity = q2+q5+q7+q11+q13+q15;
    var practicality = q4+q6+q8+q10+q14;
    if (practicality > 14) { typology = "You are a PRAGMATIST\nYou are a very busy clinician who is most concerned about the practical implications of new information. Any attempt to induce you to change certain aspects of your practice comes up against numerous, often conflicting, demands from patients, colleagues and employers."; }
    if (evidence > 21 && nonconformity > 18 && practicality < 15) { typology = "You are a SEEKER\nYou read professional journals and frequently use databases. You generally adopt a viewpoint based on evidence in the literature. You do not hesitate to abandon recognized practices when research findings cast doubt on them or to adopt new practices if there is positive evidence for them."; }
    if (evidence > 21 && nonconformity < 19 && practicality < 15) { typology = "You are a SEEKER\nYou read professional journals and frequently use databases. You generally adopt a viewpoint based on evidence in the literature. You do not hesitate to abandon recognized practices when research findings cast doubt on them or to adopt new practices if there is positive evidence for them."; }
    if (evidence > 17 && evidence < 22  && nonconformity < 19 && practicality < 15) { typology = "You are a RECEPTIVE\nYou tend to modify your practice based on new information, provided it is from a solid scientific and clinical source."; }
    if (evidence > 17 && evidence < 22  && nonconformity > 18 && practicality < 15) { typology = "You are a RECEPTIVE\nYou tend to modify your practice based on new information, provided it is from a solid scientific and clinical source."; }
    if (evidence < 18 && practicality < 15) { typology = "You are a TRADITIONALIST\nYou rely on authoritative sources in deciding to make changes in your clinical practice in response to new information. However, since your learning style is based mainly on training and personal clinical experience, you give more weight to clinical skills, experience and the authority of the change promoters."; }
    document.getElementById("typol").value = typology;
    }
    function teste() {
    	if (document.getElementById('nom').value.length == 0) { alert("You must specify a username!"); nopass=1; }
    	if (q1 == 0)  { alert("Please, answer Question 1");  nopass=1; }
    	if (q2 == 0)  { alert("Please, answer Question 2");  nopass=1; }
    	if (q3 == 0)  { alert("Please, answer Question 3");  nopass=1; }
    	if (q4 == 0)  { alert("Please, answer Question 4");  nopass=1; }
    	if (q5 == 0)  { alert("Please, answer Question 5");  nopass=1; }
    	if (q6 == 0)  { alert("Please, answer Question 6");  nopass=1; }
    	if (q7 == 0)  { alert("Please, answer Question 7");  nopass=1; }
    	if (q8 == 0)  { alert("Please, answer Question 8");  nopass=1; }
    	if (q9 == 0)  { alert("Please, answer Question 9");  nopass=1; }
    	if (q10 == 0) { alert("Please, answer Question 10"); nopass=1; }
    	if (q11 == 0) { alert("Please, answer Question 11"); nopass=1; }
    	if (q12 == 0) { alert("Please, answer Question 12"); nopass=1; }
    	if (q13 == 0) { alert("Please, answer Question 13"); nopass=1; }
    	if (q14 == 0) { alert("Please, answer Question 14"); nopass=1; }
    	if (q15 == 0) { alert("Please, answer Question 15"); nopass=1; }
    	if (q16 == 0) { alert("Please, answer Question 16"); nopass=1; }
    	if (q17 == 0) { alert("Please, answer Question 17"); nopass=1; }
    	return; 
    }
    function go() {
    	teste();
    	if (nopass == "0") {
    		var letout="";
    		var nom = document.getElementById("nom").value;
    		var letout= nom + ";" + maintenant + ";" + q1 + ";" +q2 + ";" +q3 + ";" +q4 + ";" +q5 + ";" +q6 + ";" +q7 + ";" +q8 + ";" +q9 + ";" +q10 + ";" +q11 + ";" +q12 + ";" +q13 + ";" +q14 + ";" +q15 + ";" +q16 + ";" +q17;
    		// alert(letout);
    		document.getElementById("addition").value = letout;
    		// alert (document.getElementById("addition").value);
    		typo();
    		alert("Send us your result by clicking on the SEND button at the bottom of the page!")
    	}
    nopass=0;
    }
    function efface() {
    q1=q2=q3=q4=q5=q6=q7=q8=q9=q10=q11=q12=q13=q14=q15=q16=q17=0;
    nopass=0;
    evidence = 0;
    nonconformity = 0;
    practicallity = 0;
    typology = 0;
    }
    // -->
    </script>
    <?php
    header('Location: rmavc_en.php');
    $fn = "rmavcdata.txt";
    $file = fopen($fn, "a+");
    $space.= "\n";
    if(isset($_POST['addition'])){
    fwrite($file, $_POST["addition"]);
    fwrite ($file, $space);
     
    }
    fclose($file);
    ?>
    <style type="text/css">
    table {
    	border: 1px inset #8B8378;
    	font-size: 1.1em;
    }
    table td {
    	border: 0px solid black;
    	padding: 0.2em 2ex 0.2em 2ex;
    	color: black;
    	text-align: center;
    }
    table td.left {
    	text-align: left;
    }
    table tr.d0 td {
    	background-color: #FCF6CF;
    }
    table tr.d1 td {
    	background-color: #FEFEF2;
    }
    .bigButton {
      width: 1.5em; height: 1.5em;
    }
    .gras {
    	font-weight: bold;
    }
     
    .bigText {
      font-size: 1.2em;
    }
     
    textarea {
    background-color: #fefef2;
    color: #7f0000;
    font-size: 1.3em;
    font-weight: bold;
    }
     
    h2{
    text-decoration : none;
    color : #7f0000;
    } 
    </style>
    </head>
     
    <body>
     
    <form action="<?=$PHP_SELF?>" method="post" id="quiz">
    <h2>TYPOLOGY CALCULATOR</h2><p class ="bigText"><strong>Enter your username here:</strong>&nbsp;<input  class="bigText" type="text" size="15" name="nom" id="nom" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Fill the form then click on CALCULATE to get your typology</p>
     
    <table border="0">
    <tr>
    <th>NO</th>
    <th>QUESTION</th>
    <th>&nbsp;&nbsp;STRONGLY&nbsp;&nbsp;<br/>&nbsp;&nbsp;DISAGREE&nbsp;&nbsp;</th>
    <th>&nbsp;&nbsp;DISAGREE&nbsp;&nbsp;</th>
    <th>&nbsp;&nbsp;NEUTRAL&nbsp;&nbsp;</th>
    <th>&nbsp;&nbsp;AGREE&nbsp;&nbsp;</th>
    <th>&nbsp;&nbsp;STRONGLY&nbsp;&nbsp;<br/>&nbsp;&nbsp;AGREE&nbsp;&nbsp;</th>
    </tr>
    <tr class = "d0">
    <td>1</td>
    <td class = "left">Clinical experience is more important than randomized controlled trials.</td>
    <td><input class="bigButton" type="radio" name="radq1" onclick="q1=5" /></td>
    <td><input class="bigButton" type="radio" name="radq1" onclick="q1=4" /></td>
    <td><input class="bigButton" type="radio" name="radq1" onclick="q1=3" /></td>
    <td><input class="bigButton" type="radio" name="radq1" onclick="q1=2" /></td>
    <td><input class="bigButton" type="radio" name="radq1" onclick="q1=1" /></td>
    </tr>
    <tr class = "d1">
    <td>2</td>
    <td class = "left">I am comfortable practicing in a different way from my colleagues.</td>
    <td><input class="bigButton" type="radio" name="radq2" onclick="q2=1" /></td>
    <td><input class="bigButton" type="radio" name="radq2" onclick="q2=2" /></td>
    <td><input class="bigButton" type="radio" name="radq2" onclick="q2=3" /></td>
    <td><input class="bigButton" type="radio" name="radq2" onclick="q2=4" /></td>
    <td><input class="bigButton" type="radio" name="radq2" onclick="q2=5" /></td>
    </tr>
    <tr class = "d0">
    <td>3</td>
    <td class = "left">Evidence-based practice makes a lot of sense to me.</td>
    <td><input class="bigButton" type="radio" name="radq3" onclick="q3=1" /></td>
    <td><input class="bigButton" type="radio" name="radq3" onclick="q3=2" /></td>
    <td><input class="bigButton" type="radio" name="radq3" onclick="q3=3" /></td>
    <td><input class="bigButton" type="radio" name="radq3" onclick="q3=4" /></td>
    <td><input class="bigButton" type="radio" name="radq3" onclick="q3=5" /></td>
    </tr>
    <tr class = "d1">
    <td>4</td>
    <td class = "left">I don't have the time to read up on every practice decision.</td>
    <td><input class="bigButton" type="radio" name="radq4" onclick="q4=1" /></td>
    <td><input class="bigButton" type="radio" name="radq4" onclick="q4=2" /></td>
    <td><input class="bigButton" type="radio" name="radq4" onclick="q4=3" /></td>
    <td><input class="bigButton" type="radio" name="radq4" onclick="q4=4" /></td>
    <td><input class="bigButton" type="radio" name="radq4" onclick="q4=5" /></td>
    </tr>
    <tr class = "d0">
    <td>5</td>
    <td class = "left">It is best to change the way I treat a certain problem when my local colleagues are making the same changes.</td>
    <td><input class="bigButton" type="radio" name="radq5" onclick="q5=5" /></td>
    <td><input class="bigButton" type="radio" name="radq5" onclick="q5=4" /></td>
    <td><input class="bigButton" type="radio" name="radq5" onclick="q5=3" /></td>
    <td><input class="bigButton" type="radio" name="radq5" onclick="q5=2" /></td>
    <td><input class="bigButton" type="radio" name="radq5" onclick="q5=1" /></td>
    </tr>
    <tr class = "d1">
    <td>6</td>
    <td class = "left">I follow practice guidelines if they are not too much hassle.</td>
    <td><input class="bigButton" type="radio" name="radq6" onclick="q6=1" /></td>
    <td><input class="bigButton" type="radio" name="radq6" onclick="q6=2" /></td>
    <td><input class="bigButton" type="radio" name="radq6" onclick="q6=3" /></td>
    <td><input class="bigButton" type="radio" name="radq6" onclick="q6=4" /></td>
    <td><input class="bigButton" type="radio" name="radq6" onclick="q6=5" /></td>
    </tr>
    <tr class = "d0">
    <td>7</td>
    <td class = "left">The opinions of respected authorities should guide clinical practice.</td>
    <td><input class="bigButton" type="radio" name="radq7" onclick="q7=5" /></td>
    <td><input class="bigButton" type="radio" name="radq7" onclick="q7=4" /></td>
    <td><input class="bigButton" type="radio" name="radq7" onclick="q7=3" /></td>
    <td><input class="bigButton" type="radio" name="radq7" onclick="q7=2" /></td>
    <td><input class="bigButton" type="radio" name="radq7" onclick="q7=1" /></td>
    </tr>
    <tr class = "d1">
    <td>8</td>
    <td class = "left">I am too busy to keep up with the recent literature.</td>
    <td><input class="bigButton" type="radio" name="radq8" onclick="q8=1" /></td>
    <td><input class="bigButton" type="radio" name="radq8" onclick="q8=2" /></td>
    <td><input class="bigButton" type="radio" name="radq8" onclick="q8=3" /></td>
    <td><input class="bigButton" type="radio" name="radq8" onclick="q8=4" /></td>
    <td><input class="bigButton" type="radio" name="radq8" onclick="q8=5" /></td>
    </tr>
    <tr class = "d0">
    <td>9</td>
    <td class = "left">Clinical experience is the most reliable way to know what really works.</td>
    <td><input class="bigButton" type="radio" name="radq9" onclick="q9=5" /></td>
    <td><input class="bigButton" type="radio" name="radq9" onclick="q9=4" /></td>
    <td><input class="bigButton" type="radio" name="radq9" onclick="q9=3" /></td>
    <td><input class="bigButton" type="radio" name="radq9" onclick="q9=2" /></td>
    <td><input class="bigButton" type="radio" name="radq9" onclick="q9=1" /></td>
    </tr>
    <tr>
    <th>NO</th>
    <th>QUESTION</th>
    <th>&nbsp;&nbsp;STRONGLY&nbsp;&nbsp;<br/>&nbsp;&nbsp;DISAGREE&nbsp;&nbsp;</th>
    <th>&nbsp;&nbsp;DISAGREE&nbsp;&nbsp;</th>
    <th>&nbsp;&nbsp;NEUTRAL&nbsp;&nbsp;</th>
    <th>&nbsp;&nbsp;AGREE&nbsp;&nbsp;</th>
    <th>&nbsp;&nbsp;STRONGLY&nbsp;&nbsp;<br/>&nbsp;&nbsp;AGREE&nbsp;&nbsp;</th>
    </tr>
    <tr class = "d1">
    <td>10</td>
    <td class = "left">I am uncomfortable doing things differently from the way I was trained.</td>
    <td><input class="bigButton" type="radio" name="radq10" onclick="q10=1" /></td>
    <td><input class="bigButton" type="radio" name="radq10" onclick="q10=2" /></td>
    <td><input class="bigButton" type="radio" name="radq10" onclick="q10=3" /></td>
    <td><input class="bigButton" type="radio" name="radq10" onclick="q10=4" /></td>
    <td><input class="bigButton" type="radio" name="radq10" onclick="q10=5" /></td>
    </tr>
    <tr class = "d0">
    <td>11</td>
    <td class = "left">I am often critical of accepted practices.</td>
    <td><input class="bigButton" type="radio" name="radq11" onclick="q11=1" /></td>
    <td><input class="bigButton" type="radio" name="radq11" onclick="q11=2" /></td>
    <td><input class="bigButton" type="radio" name="radq11" onclick="q11=3" /></td>
    <td><input class="bigButton" type="radio" name="radq11" onclick="q11=4" /></td>
    <td><input class="bigButton" type="radio" name="radq11" onclick="q11=5" /></td>
    </tr>
    <tr class = "d1">
    <td>12</td>
    <td class = "left">Client care should be based where possible on randomized controlled trials, rather than the opinions of respected authorities.</td>
    <td><input class="bigButton" type="radio" name="radq12" onclick="q12=1" /></td>
    <td><input class="bigButton" type="radio" name="radq12" onclick="q12=2" /></td>
    <td><input class="bigButton" type="radio" name="radq12" onclick="q12=3" /></td>
    <td><input class="bigButton" type="radio" name="radq12" onclick="q12=4" /></td>
    <td><input class="bigButton" type="radio" name="radq12" onclick="q12=5" /></td>
    </tr>
    <tr class = "d0">
    <td>13</td>
    <td class = "left">My colleagues consider me to be someone who marches to my own drummer.</td>
    <td><input class="bigButton" type="radio" name="radq13" onclick="q13=1" /></td>
    <td><input class="bigButton" type="radio" name="radq13" onclick="q13=2" /></td>
    <td><input class="bigButton" type="radio" name="radq13" onclick="q13=3" /></td>
    <td><input class="bigButton" type="radio" name="radq13" onclick="q13=4" /></td>
    <td><input class="bigButton" type="radio" name="radq13" onclick="q13=5" /></td>
    </tr>
    <tr class = "d1">
    <td>14</td>
    <td class = "left">I follow practice guidelines as long as they don't interfere too much with the flow of clients.</td>
    <td><input class="bigButton" type="radio" name="radq14" onclick="q14=1" /></td>
    <td><input class="bigButton" type="radio" name="radq14" onclick="q14=2" /></td>
    <td><input class="bigButton" type="radio" name="radq14" onclick="q14=3" /></td>
    <td><input class="bigButton" type="radio" name="radq14" onclick="q14=4" /></td>
    <td><input class="bigButton" type="radio" name="radq14" onclick="q14=5" /></td>
    </tr>
    <tr class = "d0">
    <td>15</td>
    <td class = "left">It is not prudent to practice differently from my colleagues.</td>
    <td><input class="bigButton" type="radio" name="radq15" onclick="q15=5" /></td>
    <td><input class="bigButton" type="radio" name="radq15" onclick="q15=4" /></td>
    <td><input class="bigButton" type="radio" name="radq15" onclick="q15=3" /></td>
    <td><input class="bigButton" type="radio" name="radq15" onclick="q15=2" /></td>
    <td><input class="bigButton" type="radio" name="radq15" onclick="q15=1" /></td>
    </tr>
    <tr class = "d1">
    <td>16</td>
    <td class = "left">The best practice guidelines are based on the results of randomized controlled trials.</td>
    <td><input class="bigButton" type="radio" name="radq16" onclick="q16=1" /></td>
    <td><input class="bigButton" type="radio" name="radq16" onclick="q16=2" /></td>
    <td><input class="bigButton" type="radio" name="radq16" onclick="q16=3" /></td>
    <td><input class="bigButton" type="radio" name="radq16" onclick="q16=4" /></td>
    <td><input class="bigButton" type="radio" name="radq16" onclick="q16=5" /></td>
    </tr>
    <tr class = "d0">
    <td>17</td>
    <td class = "left">Evidence-based practice is not very practical in clinical reality.</td>
    <td><input class="bigButton" type="radio" name="radq17" onclick="q17=5" /></td>
    <td><input class="bigButton" type="radio" name="radq17" onclick="q17=4" /></td>
    <td><input class="bigButton" type="radio" name="radq17" onclick="q17=3" /></td>
    <td><input class="bigButton" type="radio" name="radq17" onclick="q17=2" /></td>
    <td><input class="bigButton" type="radio" name="radq17" onclick="q17=1" /></td>
    </tr>
    </table>
    <p>
    <input type="button" value="CALCULATE" onclick="go()" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <input type="reset" value="RESET" onclick="efface()" />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
    <input type="submit" name="soumettre" id="soumettre" value="SEND - Send us your score"  />
    <input type="hidden" id="addition" name="addition" />
    </p>
    <p class="gras">YOUR RESULT:</p>
    <p><textarea name="typol" id="typol" rows="6" cols="80" readonly="readonly"></textarea></p>
    </form>
     
     
     <p>
        <a href="http://validator.w3.org/check?uri=referer"><img
            src="http://www.w3.org/Icons/valid-xhtml10"
           alt="Valid XHTML 1.0 Strict" height="31" width="88" /></a>
    		    <a href="http://jigsaw.w3.org/css-validator/check/referer">
            <img style="border:0;width:88px;height:31px"
                src="http://jigsaw.w3.org/css-validator/images/vcss"
                alt="CSS Valide !" />
        </a>
     
      </p>
     
    </body></html>

  2. #2
    Expert éminent sénior

    Homme Profil pro
    Développeur Web
    Inscrit en
    Septembre 2010
    Messages
    5 383
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Puy de Dôme (Auvergne)

    Informations professionnelles :
    Activité : Développeur Web
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Septembre 2010
    Messages : 5 383
    Points : 10 411
    Points
    10 411
    Par défaut
    Faut RIEN afficher avant un header et là je vois <!DOCTYPE html PUBLIC...

    Mets ton code php avant.

    Sur le principe ça devrait plutôt ressembler à ça

    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
    <?php
    if (isset($_POST['texte']))
    {
    	//Traitement php
     
    	//à la fin du traitement php rechargement de la page ($_SERVER['PHP_SELF'] indique la même page)
    	header("Location: ".$_SERVER['PHP_SELF']);
    }
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>titre</title>
    </head>
     
    <body>
    <form action = "#" method = "post">
    <input type = "text" name= "texte" />
    <input type = "submit" value = "envoyer" />
    </form>
    </body>
    </html>

  3. #3
    Futur Membre du Club
    Profil pro
    Inscrit en
    Janvier 2011
    Messages
    4
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Janvier 2011
    Messages : 4
    Points : 5
    Points
    5
    Par défaut Super
    Tout va pour le mieux madame la "header".

    Merci beaucoup.

    Maintenant, les "actualisations intempestives (refresh, f5, etc" ne provoquent pas la resoumission du formulaire.

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

Discussions similaires

  1. [PHP-JS] problème headers already sent
    Par charlene44 dans le forum Langage
    Réponses: 12
    Dernier message: 14/06/2006, 13h55
  2. Réponses: 11
    Dernier message: 11/05/2006, 11h16
  3. [Cookies] cookies et 'headers already sent'
    Par wellser dans le forum Langage
    Réponses: 5
    Dernier message: 26/04/2006, 13h37
  4. [Cookies] Warning : headers already sent
    Par arti2004 dans le forum Langage
    Réponses: 8
    Dernier message: 04/04/2006, 16h31
  5. [JpGraph] Header already sent
    Par grunk dans le forum Bibliothèques et frameworks
    Réponses: 1
    Dernier message: 09/02/2006, 16h54

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