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 :

Warning: Cannot modify header information - headers already sent by


Sujet :

Langage PHP

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre averti
    Homme Profil pro
    Consultant informatique
    Inscrit en
    Janvier 2015
    Messages
    29
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Bouches du Rhône (Provence Alpes Côte d'Azur)

    Informations professionnelles :
    Activité : Consultant informatique
    Secteur : Conseil

    Informations forums :
    Inscription : Janvier 2015
    Messages : 29
    Par défaut Warning: Cannot modify header information - headers already sent by
    Bonjour,

    J’ai énormément besoin de votre aide c’est à devenir fou, je ne comprends pas toutes mes pages fonctionne mise à part celle-ci-dessous. Les heures tournent mais aucune solution aucune logique… ☹

    J’ai collé head directement dans la page, normalement c’est un include (cette include contient la balise style contenant elle-même un include)

    J’obtiens ce message d’erreur : Warning: Cannot modify header information - headers already sent by (output started at D:\wamp64\www\projet\1\production.php:152) in D:\wamp64\www\projet\1\production.php on line 314

    Avec à la ligne 152 => un echo dans le style (à partir du quelle il remonte une erreur sur les echo dans style) « border-left: 8px solid <?php echo $couleur_err;?> »

    Avec à la ligne 297 => header ('Location: accueil.php');??

    En espérant grandement que vous pourriez m’aider…

    Je vous remercie par avance,

    J'ai essayé de nombreuses solution visibles sur les forums (je suis tout en utf-8 sans BOM)

    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
     
    <html>
    <?php //ob_start();
    include('includes/config.php');
    $page='production'; 
    ?>
    <head>
    <style type="text/css">
    a:link{text-decoration:none}
    /*************** Menu ********************/
    /* menu de navigation*/
    #menui /*Couleur de fonds, bordure et marges du menu*/{
    	width: 100%;
    	padding: 1% 0% 2% 0%; /*(haut, droit, bas, gauche )*/
    	margin:  0% 0% 0% 0%; /*(haut, droit, bas, gauche )*/
    	list-style: none  /* Types de puces */;
    	background: <?php echo $couleur_menu_back_1; ?>; <!-- Je en sais pas ou è¡*change -->
    	background: -moz-linear-gradient(<?php echo $couleur_menu_back_1; ?>, <?php echo $couleur_menu_back_2; ?>);<!-- couleur du haut du menu / couleur du bas  -->
    	background: -webkit-gradient(linear,left bottom,left top,color-stop(0, <?php echo $couleur_menu_back_2; ?>),color-stop(1, <?php echo $couleur_menu_back_1; ?>));
    	background: -webkit-linear-gradient(<?php echo $couleur_menu_back_1; ?>, <?php echo $couleur_menu_back_2; ?>);
    	background: -o-linear-gradient(<?php echo $couleur_menu_back_1; ?>, <?php echo $couleur_menu_back_2; ?>);
    	background: -ms-linear-gradient(<?php echo $couleur_menu_back_1; ?>, <?php echo $couleur_menu_back_2; ?>);
    	background: linear-gradient(<?php echo $couleur_menu_back_1; ?>, <?php echo $couleur_menu_back_2; ?>);
    	position: relative;
    	/*opacity: 0.5;*/
    }
    #menui li{
            float: left;
            padding: 0 0 10px 0;
            position: relative;
    }
    #menui a{
            float: left;
            height: 25px;
            padding: 0 25px;
            color: #f2f2f2;<!-- Police taille police/padding avec haut -->
            text-transform: uppercase;
            font: bold 23px/20px Arial, Helvetica; <!-- Police taille police/padding avec haut -->
            text-decoration: none;
            text-shadow: 0 1px 0 #000;
    }
    #menui li:hover > a{
            color: white;
    }
     
    *html #menui li a:hover{ /* IE6 */
            color: #fafafa;
    }
     
    #menui li:hover > ul{
            display: block;
    }
    /* Sous-menus */
    #menui ul{ 
        list-style: none;
        margin: 0;
        padding: 0;
        display: none;
        position: absolute;
        top: 35px;
        left: 0;
        z-index: 99999;
        background: <?php echo $couleur_menu_back_1; ?>;
        background: -moz-linear-gradient(<?php echo $couleur_menu_back_1; ?>, <?php echo $couleur_menu_back_2; ?>);
        background: -webkit-gradient(linear,left bottom,left top,color-stop(0, <?php echo $couleur_menu_back_2; ?>),color-stop(1, <?php echo $couleur_menu_back_1; ?>));
        background: -webkit-linear-gradient(<?php echo $couleur_menu_back_1; ?>, <?php echo $couleur_menu_back_2; ?>);
        background: -o-linear-gradient(<?php echo $couleur_menu_back_1; ?>, <?php echo $couleur_menu_back_2; ?>);
        background: -ms-linear-gradient(<?php echo $couleur_menu_back_1; ?>, <?php echo $couleur_menu_back_2; ?>);
        background: linear-gradient(<?php echo $couleur_menu_back_1; ?>, <?php echo $couleur_menu_back_2; ?>);
        -moz-border-radius: 5px;
        border-radius: 5px;
    }
    #menui ul li{
        float: none;
        margin: 0;
        padding: 0;
        display: block;
        -moz-box-shadow: 0 1px 0 <?php echo $couleur_menu_back_2; ?>, 0 2px 0 <?php echo $couleur_menu_back_2; ?>;
        -webkit-box-shadow: 0 1px 0 <?php echo $couleur_menu_back_2; ?>, 0 2px 0 <?php echo $couleur_menu_back_2; ?>;
        box-shadow: 0 1px 0 <?php echo $couleur_menu_back_2; ?>, 0 2px 0 <?php echo $couleur_menu_back_2; ?>;
    }
    #menui ul li:last-child{
        -moz-box-shadow: none;
        -webkit-box-shadow: none;
        box-shadow: none;
    }
    #menui ul a{
        padding: 10px;
        height: auto;
        line-height: 1;
        display: block;
        white-space: nowrap;
        float: none;
        text-transform: none;
    }
    *html #menui ul a{ /* IE6 */
            height: 10px;
            width: 150px;
    }
    *:first-child+html #menui ul a{ /* IE7 */
            height: 10px;
            width: 150px;
    }
    #menui ul a:hover{
            background: <?php echo $couleur_sm_back_a_2; ?>;
            background: -moz-linear-gradient(<?php echo $couleur_sm_back_a_1; ?>,  <?php echo $couleur_sm_back_a_2; ?>);
            background: -webkit-gradient(linear, left top, left bottom, from(<?php echo $couleur_sm_back_a_1; ?>), to(<?php echo $couleur_sm_back_a_2; ?>));
            background: -webkit-linear-gradient(<?php echo $couleur_sm_back_a_1; ?>, <?php echo $couleur_sm_back_a_2; ?>);
            background: -o-linear-gradient(<?php echo $couleur_sm_back_a_1; ?>, <?php echo $couleur_sm_back_a_2; ?>);
            background: -ms-linear-gradient(<?php echo $couleur_sm_back_a_1; ?>, <?php echo $couleur_sm_back_a_2; ?>);
            background: linear-gradient(<?php echo $couleur_sm_back_a_1; ?>, <?php echo $couleur_sm_back_a_2; ?>);
    }
    #menui ul li:first-child a{
        -moz-border-radius: 5px 5px 0 0;
        -webkit-border-radius: 5px 5px 0 0;
        border-radius: 5px 5px 0 0;
    }
    #menui ul li:first-child a:after{
        content: '';
        position: absolute;
        left: 30px;
        top: -8px;
        width: 0;
        height: 0;
        border-left: 5px solid transparent;
        border-right: 5px solid transparent;
        border-bottom: 8px solid <?php echo $couleur_menu_back_1; ?>; /*Couleur du petit triangle en haut du sous menu */
    }
    #menui ul li:first-child a:hover:after{ 
        border-bottom-color: <?php echo $couleur_sm_back_a_1; ?>; /*Couleur du petit triangle au survol en haut du sous menu */
    }
    #menui ul li:last-child a{
        -moz-border-radius: 0 0 5px 5px;
        -webkit-border-radius: 0 0 5px 5px;
        border-radius: 0 0 5px 5px;
    }
    /* R굡blissement du flottement */
    #menui:after{
            visibility: hidden;
            display: block;
            font-size: 0;
            content: " ";
            clear: both;
            height: 0;
    }
    * html #menui             { zoom: 1; } /* IE6 */
    *:first-child+html #menui { zoom: 1; } /* IE7 */
    /* Les messages OK et KO */
    #div_err_tr
    	{
    	border-top: 8px solid transparent;
    	border-bottom: 8px solid transparent;
    	border-left: 8px solid <?php echo $couleur_err;?>
    	}
    #div_ok_tr
    	{
    	border-top: 8px solid transparent;
    	border-bottom: 8px solid transparent;
    	border-left: 8px solid <?php echo $couleur_ok;?>
    	}
    /* Les fonds (images, img banières...) */
    <?php
    //On récup l'id fond_haut et son ext 
    $resultat = mysqli_query($bdd, 'SELECT id_visuel, type FROM t_visuels WHERE id_artiste = '.$id_artiste.' and statut=1 and contenu="fond_haut"');
    while($t_visuels = mysqli_fetch_assoc($resultat)) 
    	{ $id_visuel=$t_visuels['id_visuel']; 
    	$type=$t_visuels['type'];
    	$img_fond_haut=$id_visuel.'.'.$type;} 
    //On récup l'id fond_haut et son ext 
    $resultat = mysqli_query($bdd, 'SELECT id_visuel, type FROM t_visuels WHERE id_artiste = '.$id_artiste.' and statut=1 and contenu="fond_bas"');
    while($t_visuels = mysqli_fetch_assoc($resultat)) 
    	{ $id_visuel=$t_visuels['id_visuel']; 
    	$type=$t_visuels['type'];
    	$img_fond_bas=$id_visuel.'.'.$type;} 
     
    //Si besoin on récup la bani鳥 correspondante et son ext
    if (isset($page) and ($page=='infos_artiste'))
    	{
    	if ($_GET ['objet']=='infos')
    		{
    		$resultat = mysqli_query($bdd, 'SELECT id_visuel, type FROM t_visuels WHERE id_artiste = '.$id_artiste.' and statut=1 and contenu="ban_infos"');
    		while($t_visuels = mysqli_fetch_assoc($resultat)) 
    			{ $id_visuel=$t_visuels['id_visuel']; 
    			$type=$t_visuels['type'];
    			$img_ban=$id_visuel.'.'.$type;} 
    		}
    	elseif ($_GET ['objet']=='contacts')
    		{
    		$resultat = mysqli_query($bdd, 'SELECT id_visuel, type FROM t_visuels WHERE id_artiste = '.$id_artiste.' and statut=1 and contenu="ban_contacts"');
    		while($t_visuels = mysqli_fetch_assoc($resultat)) 
    			{ $id_visuel=$t_visuels['id_visuel']; 
    			$type=$t_visuels['type'];
    			$img_ban=$id_visuel.'.'.$type;} 
    		}
    	}
    elseif (isset($page) and ($page=='accueil'))
    	{
    	$resultat = mysqli_query($bdd, 'SELECT id_visuel, type FROM t_visuels WHERE id_artiste = '.$id_artiste.' and statut=1 and contenu="ban_accueil"');
    	while($t_visuels = mysqli_fetch_assoc($resultat)) 
    		{ $id_visuel=$t_visuels['id_visuel']; 
    		$type=$t_visuels['type'];
    		$img_ban=$id_visuel.'.'.$type;} 
    	}
    else
    	{
    	if (isset($page) and ($page=='production'))
    		{$_GET ['menu']=$id_menu_parent;
    		$resultat = mysqli_query($bdd, 'SELECT id_visuel, type FROM t_visuels WHERE id_artiste = '.$id_artiste.' and tstatut=1 and contenu="ban" and id_menu_parent= '.$id_menu_parent.'');
    		while($t_visuels = mysqli_fetch_assoc($resultat)) 
    			{ $id_visuel=$t_visuels['id_visuel']; 
    			$type=$t_visuels['type'];
    			$img_ban=$id_visuel.'.'.$type;} 
    		}
    	} ?><!--- background: transparent url('includes/visuels/<?php //echo $id_artiste;?>/<?php //echo $img_ban;?>'); --->
    html { 
    	background:black;
    	width:100%;
    	height:100%;
    	}
    body { 
    	margin: auto; 
    	width: 95%;
    	min-width: 1250px;
    	max-width: 1500px; 
    	background: url("includes/visuels/<?php echo $id_artiste;?>/<?php echo $img_fond_haut;?>") no-repeat;
    	}
    header {
    	margin: 10px 0px 0px 0px;
    	height: 315px;
    	background-image: url("includes/visuels/<?php echo $id_artiste;?>/<?php echo $img_ban;?>");
    	display:block;
    	background-repeat: no-repeat ;
    	}
    footer 
    	{ 
    	margin: 0px 0px 0px 0px;
    	height: 300px;
    	background-image: url("includes/visuels/<?php echo $id_artiste;?>/<?php echo $img_fond_bas;?>");
    	background-repeat: no-repeat ;
    	}	
    #sect_body
    	{ 
    	min-height: 700px;
    	margin: 0px 0px 0px 0px;
    	background-image: url("includes/visuels/<?php echo $id_artiste;?>/<?php echo $img_fond_bas;?>");
    	background-repeat: no-repeat ;
    	background-position: bottom left;
    	float:none;
    	}
    /* les images*/	
    /* les visuels*/		
    #imgs_visuels	
    	{ 
    	min-height: 50px;
    	max-width: 650px;
    	}
    /* les boutons*/	
    .sub_pos /* KO????? */
    	{ 
    	margin: 2px 2px 2px 2px;
    	width:220px;
    	height: 70px;
    	font-family:Arial, Helvetica, sans-serif;
    	}
    .form 	input[type=submit]{
    	background:url(includes/visuels/<?php echo $id_artiste;?>/<?php echo $img_fond_bas;?>) top right no-repeat;
    	width:220px;
    	height: 70px;
    	padding: 0 0 0 10px;
    	cursor: pointer;
    	border:0;
    }
    	</style> 
    	<meta http-equiv="Content-type" content="text/html; charset=UTF-8"/>
    	<title></title> 
    </head>
    	<header >
    		<hr color="<?php echo $couleur_1; ?>">
    		<section id="" style="color:<?php echo $couleur_police; ?>">
     
    		</section>			
    		<br />
    		<nav > 
    		</nav>
    			<hr color="<?php echo $couleur_1; ?>">
    	</header>
    <?php //ob_end_flush();?>
     
     
    <body style="background-color:<?php echo $couleur_fond; ?>;">
    	<section id="sect_body">
    <a name="haut"></a>
    <?php
     
    if (isset($_GET ['menu'])) //On récupère les données menu en BDD & on controle si cela correspond bien à l'artiste et est la donnée est active
    	{ 
     
    	}  else {header ('Location: accueil.php');}
     ?>
    </body >	
     
    </html>

  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
    Par défaut
    Tu ne peux pas avoir un header() après un echo.
    N'oubliez pas de consulter les FAQ PHP et les cours et tutoriels PHP

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

Discussions similaires

  1. Réponses: 6
    Dernier message: 03/05/2011, 19h14
  2. Réponses: 2
    Dernier message: 13/04/2011, 10h28
  3. Réponses: 2
    Dernier message: 09/02/2010, 20h32
  4. Réponses: 1
    Dernier message: 17/07/2007, 11h49
  5. Réponses: 4
    Dernier message: 16/07/2007, 13h42

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