Bonjour à tous,
Php_error m'indique cette erreur :
Je l'ai souvent résolu en supprimant un espace glissé avant le session_start(), ... Mais ici je ne trouve vraiment pas ce qui cloche !![26-Feb-2014 12:43:48 Europe/Berlin] PHP Warning: Cannot modify header information - headers already sent by (output started at /Applications/MAMP/htdocs/PressIn_21022014/includes/head.php:2) in /Applications/MAMP/htdocs/PressIn_21022014/recap_commande.php on line 41
voici mon code qui active l'erreur lorsque je clique sur le bouton valider_commande :
Et voici mon head.php auquel il me renvoi ligne 2???
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 <?php session_start(); if(isset($_SESSION['auth']) && $_SESSION['auth'] == true){ $document = basename(__FILE__); $titre = "Espace Membre"; include("includes/head.php"); ?> <div class="background col-xs-12 col-sm-12 col-md-12 col-lg-12"> <div class="container top"> <div class="elements"> <form id="form_top_ten" method="POST" action="recap_commande.php"> <div class="row"> <div class="col-xs-12 col-sm-6 col-md-6 col-lg-6"> <div class="commande_top_ten"> <div class="col-xs-3 col-sm-4 col-md-4 col-lg-3"><h4>Veste</h4></div> <img src="img/icone_veste.svg" /> <button id="moins_veste" type="button" class="btn-moins btn-circle btn-mini"><i class="glyphicon-minus"></i> </button> <span class="quantite" id="top_ten_nb_veste">1</span> <button id="plus_veste" type="button" class="btn-plus btn-circle btn-mini"><i class="glyphicon-plus"></i> </button> <div class="prix"><span class="prix_pantalon"> 10</span> </div> </div> </div> <div class="col-xs-12 col-sm-6 col-md-6 col-lg-6"> <div class="commande_top_ten"> <div class="col-xs-3 col-sm-4 col-md-4 col-lg-3"><h4>Pantalon</h4></div> <img src="img/icone_pant.svg" /> <button id="moins_pantalon" type="button" class="btn-moins btn-circle btn-mini"><i class="glyphicon-minus"></i> </button> <span class="quantite" id="top_ten_nb_pantalon">1</span> <button id="plus_pantalon" type="button" class="btn-plus btn-circle btn-mini"><i class="glyphicon-plus"></i> </button> <div class="prix"><span class="prix_pantalon"> 10</span> </div> </div> </div> </div> <div class="row"> <div class="col-xs-12 col-sm-6 col-md-6 col-lg-6"> <div class="commande_top_ten"> <div class="col-xs-3 col-sm-4 col-md-4 col-lg-3"><h4>Chemise</h4></div> <img src="img/icone_chemise.svg" /> <button id="moins_chemise" type="button" class="btn-moins btn-circle btn-mini"><i class="glyphicon-minus"></i> </button> <span class="quantite" id="top_ten_nb_chemise">1</span> <button id="plus_chemise" type="button" class="btn-plus btn-circle btn-mini"><i class="glyphicon-plus"></i> </button> <div class="prix"><span class="prix_pantalon"> 10</span> </div> </div> </div> <div class="col-xs-12 col-sm-6 col-md-6 col-lg-6"> <div class="commande_top_ten"> <div class="col-xs-3 col-sm-4 col-md-4 col-lg-3"><h4>Robe</h4></div> <img src="img/icone_robe.svg" /> <button id="moins_robe" type="button" class="btn-moins btn-circle btn-mini"><i class="glyphicon-minus"></i> </button> <span class="quantite" id="top_ten_nb_robe">1</span> <button id="plus_robe" type="button" class="btn-plus btn-circle btn-mini"><i class="glyphicon-plus"></i> </button> <div class="prix"><span class="prix_pantalon"> 10</span> </div> </div> </div> </div> <div class="row"> <div class="col-xs-12 col-sm-6 col-md-6 col-lg-6"> <div class="commande_top_ten"> <div class="col-xs-3 col-sm-4 col-md-4 col-lg-3"><h4>Manteau</h4></div> <img src="img/icone_manteau.svg" /> <button id="moins_manteau" type="button" class="btn-moins btn-circle btn-mini"><i class="glyphicon-minus"></i> </button> <span class="quantite" id="top_ten_nb_manteau">1</span> <button id="plus_manteau" type="button" class="btn-plus btn-circle btn-mini"><i class="glyphicon-plus"></i> </button> <div class="prix"><span class="prix_pantalon"> 10</span> </div> </div> </div> <div class="col-xs-12 col-sm-6 col-md-6 col-lg-6"> <div class="commande_top_ten"> <div class="col-xs-3 col-sm-4 col-md-4 col-lg-3"><h4>Veste</h4></div> <img src="img/icone_pant.svg" /> <button type="button" class="btn-moins btn-circle btn-mini"><i class="glyphicon-minus"></i> </button> <span class="quantite" id="top_ten_nb_veste">1</span> <button type="button" class="btn-plus btn-circle btn-mini"><i class="glyphicon-plus"></i> </button> <div class="prix"><span class="prix_pantalon"> 10</span> </div> </div> </div> </div> <div class="row"> <div class="row col-xs-12 col-sm-6 col-md-6 col-lg-6"> <div class="commande_top_ten"> <div class="col-xs-3 col-sm-4 col-md-4 col-lg-3"><h4>Pull</h4></div> <img src="img/icone_pull.svg" /> <button id="moins_pull" type="button" class="btn-moins btn-circle btn-mini"><i class="glyphicon-minus"></i> </button> <span class="quantite" id="top_ten_nb_pull">1</span> <button id="plus_pull" type="button" class="btn-plus btn-circle btn-mini"><i class="glyphicon-plus"></i> </button> <div class="prix"><span class="prix_pantalon"> 10</span> </div> </div> </div> <div class="row col-xs-12 col-sm-6 col-md-6 col-lg-6"> <div class="commande_top_ten"> <div class="col-xs-3 col-sm-4 col-md-4 col-lg-3"><h4>Jupe</h4></div> <img src="img/icone_jupe.svg" /> <button id="moins_jupe" type="button" class="btn-moins btn-circle btn-mini"><i class="glyphicon-minus"></i> </button> <span class="quantite" id="top_ten_nb_jupe">1</span> <button id="plus_jupe" type="button" class="btn-plus btn-circle btn-mini"><i class="glyphicon-plus"></i> </button> <div class="prix"><span class="prix_pantalon"> 10</span> </div> </div> </div> </div> <div class="row"> <div class="col-xs-12 col-sm-6 col-md-6 col-lg-6"> <div class="commande_top_ten"> <div class="col-xs-3 col-sm-4 col-md-4 col-lg-3"><h4>Draps</h4></div> <img src="img/icone_drap.svg" /> <button type="moins_drap" class="btn-moins btn-circle btn-mini"><i class="glyphicon-minus"></i> </button> <span class="quantite" id="top_ten_nb_drap">1</span> <button type="plus_drap" class="btn-plus btn-circle btn-mini"><i class="glyphicon-plus"></i> </button> <div class="prix"><span class="prix_drap"> 10</span> </div> </div> </div> <div class="col-xs-12 col-sm-6 col-md-6 col-lg-6"> <div class="commande_top_ten"> <div class="col-xs-3 col-sm-4 col-md-4 col-lg-3"><h4>Chemise</h4></div> <img src="img/icone_chemisepliee.svg" /> <button type="moins_drap" class="btn-moins btn-circle btn-mini"><i class="glyphicon-minus"></i> </button> <span class="quantite" id="top_ten_nb_drap">1</span> <button type="plus_drap" class="btn-plus btn-circle btn-mini"><i class="glyphicon-plus"></i> </button> <div class="prix"><span class="prix_pantalon"> 10</span> </div> </div> </div> </div> <button type ="submit" class="btn_valider btn btn-danger col-xs-9 col-sm-6 col-md-6 col-lg-4" name="valider_commande" value="valider_commande"><i class="glyphicon glyphicon-shopping-cart"></i>Valider commande (' .$prix_total. ' euros)</button> </form> </div> </div> <?php if (!empty($_SESSION['form_top_ten'])){ $nb_articles = sizeof($_SESSION['commande_top_ten']); $prix_total = 0; for ($i=0;$i<$nb_articles;$i++){ $prix_total += $_SESSION['commande_top_ten'][$i]['prix']; } } ?> </div> <?php } else{ header('Location:auth_form.php'); } ?>
Si quelqu'un peux me donner la solution cela m'aiderait grandement !!! Merci
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9<head> <title>E-Pressing - <?php echo $titre; ?></title> <link href="css/bootstrap.css" rel="stylesheet"> <meta charset="UTF-8"> <link href="css/business-frontpage.css" rel="stylesheet"> <link href='http://fonts.googleapis.com/css?family=Poiret+One' rel='stylesheet' type='text/css'> <link href='http://fonts.googleapis.com/css?family=Lato:100,300,400,700,900,100italic,300italic,400italic,700italic,900italic' rel='stylesheet' type='text/css'> <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> </head>
Partager