Bonjour,
J'ai un soucis avec mon session_start().
Sur wamp, tout fonctionne, mais lorsque je passe sur mon serveur de prod (chez easy-hebergement) j'ai ce message d'erreur :
Pourtant mon session_start est appelé une seule fois par mon fichier conf qui après est appelé par mon header.Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /public_html/communaute3f/annuaire/index.php:1) in /public_html/communaute3f/admin/conf_serveur.php on line 2
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /public_html/communaute3f/annuaire/index.php:1) in /public_html/communaute3f/admin/conf_serveur.php on line 2
Voici le début de mon fichier conf :
Le début de mon fichier header :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10 <?php session_start(); // Généralement la machine est localhost // c'est-a-dire la machine sur laquelle le script est hébergé //$host ='localhost'; //$user ='root'; //$bdd ='3frontieres'; //$passwd =''; ...
mon fichier index :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12 <?php include('../admin/conf_serveur.php'); include('./categorie.php'); include('./tag.php'); $head=' <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <head> <title>Le portail des habitants du pays haut - 3 Frontières.com</title> <meta http-equiv="Content-type" content="text/html; charset=UTF-8"/> <link href="'.$base_url.'/style.css" rel="stylesheet" type="text/css" /> ...
et je n'appel pas la session_start dans les fichiers tag et categorie vu que c'est déjà appelé par le header.
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7 <?php include('./header.php'); echo $head; $art=''; $pagination=''; ...
Donc si vous avez une idée je suis preneur.
Partager