Précédent   Forum des professionnels en informatique > PHP > Langage > Sessions
Sessions Forum d'entraide sur les sessions avec PHP. Avant de poster -> FAQ sessions, Cours sessions et Sources sécurité
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 13/05/2008, 12h11   #1
Inscrit
 
Inscription : septembre 2005
Messages : 260
Détails du profil
Informations forums :
Inscription : septembre 2005
Messages : 260
Points : 98
Points : 98
Par défaut Problème d'entêtes avec la version 5.2 au niveau de la session

Bonjour,

J'ai un script qui fonction super bien chez 1and1 PHP Version 4.4.8

Le même script chez seconde.fr ne fonctionne pas PHP Version 5.2


ERREUR

Code :
1
2
 
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/lettecom/public_html/teste/index.php:9) in /home/lettecom/public_html/teste/fichier_n/loginui.php on line 2

loginui.php
Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
<?php
session_start();
if (!file_exists('include/config.php')){
echo "<p align=center><br><br><br>ATTENTION : vous n’avez pas le droit d’acceder a cette adresse.";
exit;
}
include_once('include/langfun.php');
include_once('include/config.php');
include('include/utils.php'); 
include('include/header.php');
include('include/footer.php');
exit;
?>
Merci d'avance
Akim13 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 13/05/2008, 12h48   #2
Membre éprouvé
 
Avatar de SphynXz
 
Développeur Web
Inscription : mars 2008
Messages : 439
Détails du profil
Informations personnelles :
Âge : 26

Informations professionnelles :
Activité : Développeur Web

Informations forums :
Inscription : mars 2008
Messages : 439
Points : 474
Points : 474
la session se lance peut-être automatiquement avec la propriété session.auto_start mit à ON ?
__________________
I don't know what will be used in the next world war, but the 4th will be fought with stones. - Albert Einstein
Pour détourner un avion, il faut monter dedans - Frédéric beigbeder
SphynXz est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 13/05/2008, 12h49   #3
Membre éclairé
 
Inscription : mai 2008
Messages : 359
Détails du profil
Informations forums :
Inscription : mai 2008
Messages : 359
Points : 397
Points : 397
Bonjour,

qu'est-ce qu'il y a dans /teste/index.php, ligne 9, qui provoque un output?
Tsilefy est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 13/05/2008, 13h14   #4
Inscrit
 
Inscription : septembre 2005
Messages : 260
Détails du profil
Informations forums :
Inscription : septembre 2005
Messages : 260
Points : 98
Points : 98
Voila la page index


Code :
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
<HTML>
<HEAD>
 
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=windows-1251">
<link rel="stylesheet" href="main.css" type="text/css">
 
</HEAD>
<BODY BGCOLOR=#FFFFFF LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0>
<table width="778" border="0" cellspacing="0" cellpadding="0" align="center">
    <tr>
        <td><font color="#666666"><table width="778" border="0" cellspacing="0" cellpadding="0" align="center">
    <tr>
        <td><img src="images_site/index_07.jpg" width=778 height=115 alt=""></td>
    </tr>
</table>
</font></td>
    </tr>
</table>
<table width="778" border="0" cellspacing="0" cellpadding="0" align="center">
    <tr valign="top">
        <td bgcolor="#FFFFFF">
            <table width="510" border="0" cellspacing="8" cellpadding="0">
                <tr>
                    <td width="510" class="t11_grey">
                        <p><font color="#666666"><img src="images_site/index_12.jpg" width=134 height=109 alt="" align="left"></font>descri...</p>
                        <div id="page">
 
 
                            <div id="corps">
 
                                <div class="gabarit2Cols">
 
 
                                    <div id="colHome">
 
                                        <div id="moteurHome">
                                        </div>
                                        <div id="rechercheRapide" class="barreGris">
                                            <p>&nbsp;</p>
 
                                        </div>
                                    </div>
                                    <div id="colDroite">
                                        <div id="blocTemoignages">
                                        </div>
                                        <div id="blocCnil">
                                            <div id="blocCnilLogo">
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
 
                            <div id="pied">
 
                                <ul id="navBottom">
                                </ul>
 
                            </div>
                        </div>
                    </td>
                </tr>
            </table>
        </td>
        <td width="268" bgcolor="white" align="right">
            <table width="268" border="0" cellspacing="0" cellpadding="0">
                <tr>
                    <td width="268"><font color="#666666"><img src="images_site/index_10.gif" width=268 height=33 alt=""></font></td>
                </tr>
            </table>
            <form name="login" action="Facturier_art_ges_fac_con.php" method="post">
                <table align="center" bgcolor="#CCCCCC" width="225" style="margin:1pt; padding:1pt; border-width:1pt; border-color:rgb(250,250,250); border-style:solid;" height="88" cellspacing="0" bordercolordark="white" bordercolorlight="black" cellpadding="0">
                    <tr>
                        <td colspan="2" height="14" width="223" bgcolor="white"><font color="#666666"><img src="images/clear.gif" height="1" width="1"><br></font></td>
                    </tr>
                    <tr>
                        <td class="signin" nowrap align="right" width="110" bordercolor="#999999" bgcolor="white" height="13" valign="top">
                            <p align="right"><font color="#666666">Nom d'utilisateur </font></p>
                        </td>
                        <td width="112" bgcolor="white" height="13">
                            <p align="left"><font color="#666666"><input type="text" name="name" size="14" maxlength=15
<? if($demomode){
                             echo "value='admin'";
                          }
                        ?> style="background-color:white; margin:1pt; padding:1pt; border-width:1pt; border-color:rgb(204,204,204); border-style:dotted;" value="admin"></font></p>
                        </td>
                    </tr>
                    <tr>
                        <td class="signin" align="right" valign="top" width="110" bgcolor="white" height="13" nowrap bordercolor="#999999">
                            <p align="right"><font color="#666666">Mot de passe </font></p>
                        </td>
                        <td width="112" bgcolor="white" height="13">
                            <p align="left"><font color="#666666"><input type='password' name='password' size="14" maxlength=15  <?
                          if($demomode){
                             echo "value='coolinc'";
                          }
                        ?> style="background-color:white; margin:1pt; padding:1pt; border-width:1pt; border-color:rgb(204,204,204); border-style:dotted;" value="demo1"></font></p>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2" align="center" width="223" height="33" bgcolor="white">
                            <p><font color="#666666"><input type="submit" name="submit" value=".    Connexion     ." style="background-color:rgb(204,204,204); margin:1pt; padding:1pt; border-width:1pt; border-color:rgb(153,153,153); border-style:dashed;"></font></p>
                        </td>
                    </tr>
                </table>
                <dt align="left">
                <div align="center"><font color="#FF6600">Nom d'utilisateur: <b>admin</b></font></div>
<div align="center"><font color="#FF6600">Mot de passe: <b>demo1</b></font></div>
            </form>
            <table width="268" border="0" cellspacing="5" cellpadding="0">
                <tr>
                    <td align="right"><font color="#666666">;</font></td>
                </tr>
            </table>
            <table width="268" border="0" cellspacing="5" cellpadding="0">
                <tr>
                    <td width="268" class="t10_yellow">
                        <p><b><font size="2" face="Verdana,Arial" color="#666666">Notre soci&eacute;t&eacute;</font></b><font color="#666666"></font></p>
                    </td>
                </tr>
            </table>
            <table width="228" border="0" cellspacing="5" cellpadding="0">
                <tr>
                    <td width="263" class="t10_white">                        
                        <dl>
                            <dt>            <b><font color="#666666">VotreSociete SARL</font></b><font color="#666666"></font></dt>
                            <dt><font color="#666666">&nbsp;</font></dt>
                            <dt><font color="#666666">1 RUE DE TOTO&nbsp;75000 PARIS</font></dt>
                            <dt><font color="#666666">&nbsp;</font></dt>
                            <dt><font color="#666666">TEL : 0411223344 FAX : 0455667788</font></dt>
                        </dl>
                    </td>
                </tr>
            </table>
      <font color="#666666"><br>
</font>            
            <table width="268" border="0" cellspacing="5" cellpadding="0">
                <tr>
                    <td width="268" class="t10_yellow">
                        <h2 class="projet_h2"><span class="projet_renovation_surligne"><font size="2" color="#666666">Par o&ugrave; commencer ?</font></span><font color="#666666"></font></h2>
                    </td>
                </tr>
            </table>
            <table width="228" border="0" cellspacing="5" cellpadding="0">
                <tr>
                    <td width="263" class="t10_white">
                        <p>&nbsp;</p>
                    </td>
                </tr>
            </table>
      <font color="#666666"><br>
</font>                </td>
    </tr>
</table>
<table width="778" border="0" cellspacing="0" cellpadding="0" align="center">
    <tr>
        <td bgcolor="white"><font color="#666666">&nbsp;</font></td>
    </tr>
</table>
<table width="778" border="0" cellspacing="8" cellpadding="0" height="50" align="center">
    <tr>
        <td class="t10_white" bgcolor="white">
            <p align="center">&nbsp;<font color="#666666"></font></p>
        </td>
        <td align="right" bgcolor="white">      <font color="#666666"></font></td>
    </tr>
</table>
<table border="0" width="614" align="center">
    <tr>
        <td width="527">
            <p align="center"><font color="#666666"><?
 
include('fichier_n/loginui.php');
$def_lan_file = getTopLangDef(".", $usr_default_lang);
if(!file_exists($def_lan_file)){
   echo "<br><br><b><font color='#FF0000'>ERROR: </font>Default language file not found: [".$def_lan_file.']</b><br><br>Please make sure you copied all files. Or you may switch default language to Francais.';
   exit;
}
 
include_once($def_lan_file);
$thislangfile = getLanguagePath(".", $usr_default_lang, 'index.php');
include_once($thislangfile);
 
//for login page, I want the page width narrower
//overwrite settings in common.php
$page_table_width = '90%';
include('include/header.php');
 
?>
</font></p>
        </td>
    </tr>
</table>
 
 
<form name="login" action="Facturier_art_ges_fac_con.php" method="post">
<font color="#666666">    <? if($demomode){  ?>
    <script language='javascript'>
                           function chgusr(u){
                              if(u == 1){
                                 document.login.name.value="admin";
                                 document.login.password.value="coolinc";
                              }else{
                                 document.login.name.value="demo";
                                 document.login.password.value="demo";
                              }
                           }
 
    </script>
</font>    <center>
                         <font color="#666666"><input type="radio" name="usrt" value="adm" checked onclick="chgusr(1);">Admin
                         <input type="radio" name="usrt" value="demo" onclick="chgusr(2);">client</font>
    </center>
<font color="#666666">    <? } ?>
     <br>    <?=IN_MEG1?><br><?=IN_MEG2?>
     </font><a href="mailto:<?=$youremail?>"><font color="#666666"><?=$youremail?></font></a><font color="#666666">,<br></font><a href="Facturier_art_ges_pass_reg.php"><font color="#666666"><?=RESETPASSWORD?></font></a><font color="#666666"><br><br>
    <? if($show_Facturier_link){?>
</font><a href="http://www.xx.com"><font color="#666666"><?=PRODUCT_INFO?></font></a><font color="#666666">
 
 <?}?>
</font></form>
<p align="center"><font color="#666666">&nbsp;</font></p>
<p align="center"><b><font size="2" face="Calligraph421 BT" color="#666666">Copyright (C) 2007 - </font><font color="#666666"> </font></b><font color="#666666"><?=LANGUAGE?>    <?
                $dir = dir('languages');
 
                while(($file = $dir->read()) !== false) {
                   if(is_file('languages/'.$file)){
                      $ext = strrchr(basename($file), '.');
                      if($ext !== '.php'){
                         continue;
                      }
                      $fn = basename($file, ".php");
 
 
                      $avail_langs[] = $fn;
                   }
                }
                sort($avail_langs);
                $nlangs = count($avail_langs);
 
                if($nlangs == 0){
                   echo "<font color=#CC0000 size='+0.5'>ERROR: <br>no language files found!</font>";
                }elseif($nlangs == 1){
                   echo "$fn <input name='lang' type='hidden' value='$fn'>";
                }else{
                   echo '<select name="lang">';
                   for($i=0; $i<$nlangs; $i++){
                      $selected = '';
                      if(strcmp($usr_default_lang, $avail_langs[$i]) == 0){
                         $selected = ' selected';
                      }
                      echo '<option value="'.$avail_langs[$i].'" '.$selected.'>'.$avail_langs[$i].'</option>';
                   }
                   echo '</select>';
                }
          ?>        </font></p>
<p align="center">&nbsp;</p>
 
</BODY>
</HTML>
Akim13 est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 13/05/2008, 13h32   #5
Membre éclairé
 
Inscription : mai 2008
Messages : 359
Détails du profil
Informations forums :
Inscription : mai 2008
Messages : 359
Points : 397
Points : 397
Ah mais voilà.
Code :
1
2
3
4
        <td width="527">
            <p align="center"><font color="#666666"><?
 
include('fichier_n/loginui.php');
Tu inclus loginui.php dans index.php, alors qu'un output est déjà délivré (tout le html qui précède l'inclusion).
Place l'include tout en haut (avant tout le html), ou enlève l'appel à session_start() dans loginui et place-le tout en haut d'index.php.
Ou, si tu tiens absolument à garder la page telle qu'elle est, regarde du côté des output buffering (ob_start et compagine).
Tsilefy est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 13/05/2008, 13h35   #6
Membre éprouvé
 
Avatar de SphynXz
 
Développeur Web
Inscription : mars 2008
Messages : 439
Détails du profil
Informations personnelles :
Âge : 26

Informations professionnelles :
Activité : Développeur Web

Informations forums :
Inscription : mars 2008
Messages : 439
Points : 474
Points : 474
Code :
include('fichier_n/loginui.php');
met cette ligne au tout début de ton fichier index
__________________
I don't know what will be used in the next world war, but the 4th will be fought with stones. - Albert Einstein
Pour détourner un avion, il faut monter dedans - Frédéric beigbeder
SphynXz est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 13/05/2008, 13h44   #7
Inscrit
 
Inscription : septembre 2005
Messages : 260
Détails du profil
Informations forums :
Inscription : septembre 2005
Messages : 260
Points : 98
Points : 98
Bonjour,

Incroyable ça fonctionne je ne le savais pas

Merci TLM
Akim13 est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité Cette discussion est résolue.
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 00h57.


 
 
 
 
Partenaires

Hébergement Web