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 :

session start et headers already sent


Sujet :

Langage PHP

  1. #1
    Nouveau membre du Club
    Profil pro
    Inscrit en
    Octobre 2005
    Messages
    106
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Octobre 2005
    Messages : 106
    Points : 37
    Points
    37
    Par défaut session start et headers already sent
    bonjour à tous,

    j'ai un petit soucis avec ma session_start()!
    je me log correctement au compte que j'ai créé et en me logan il m'affiche correctement le nom de l'utilisateur mais il m'affiche aussi un warning qui est le suivant :

    Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /var/www/62/a/r/c/arcotec.fr/www/session/index2.php:10) in index2.php on line 56

    je vous donne la partie de mon code

    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
     
    <!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">
     
    <head>
     
    <title>Arcotec | Accueil</title>
    	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    	<meta name="Description" content="Description..." />
    	<meta name="Keywords" content="Mots clés..." />
    	<link href="css/page.css" rel="stylesheet" type="text/css" />
     
    <style type="text/css">
    body {
    	background-image: url(img/FOND.gif);
    	margin-left: 0px;
    	margin-top: 0px;
    	margin-right: 0px;
    	margin-bottom: 0px;
    }
    </style>
     
    </head>
    <body bgcolor="#ffffff">
    <table style="text-align:left;border-width:0px;width:994px;" cellpadding="0" cellspacing="0">
      <tr>
       <td colspan="3"><img src="img/LOGO.gif" id="Logo" alt="Arcotec | Normes et Sécurités" style="width:628px;height:76px;"/></td>
       <td colspan="5"><img src="img/SLOGAN.gif" id="Slogan" alt="La plus belle réussite, votre confiance..." style="width:366px;height:76px;"/></td>
      </tr>
      <tr>
       <td colspan="8" style="width:994px;height:10px;background-image: url('img/A1.png');"></td>
      </tr>
      <tr>
       <td rowspan="7" style="width:15px;height:518px;background-image: url('img/A3.png');"></td>
       <td colspan="6" class="navigation" style="width:964px;height:35px;background-image: url('img/NAVIGATION.gif');">
       <a href="index.htm" class="navigation_on">Accueil</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
       <a href="catalogue.htm" class="navigation_on">Catalogue</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
       <a href="nouveautes.htm" class="navigation_on">Nouveautés</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
       <a href="engagements.htm" class="navigation_on">Nos engagements</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
       <a href="entreprises.htm" class="navigation_on">Espace client</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
       <a href="contact.htm" class="navigation_on">Nous contacter</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
       <a href="plan.htm" class="navigation_on">Plan d'accès</a></td>
       <td rowspan="7" style="width:15px;height:518px;background-image: url('img/A4.png');"></td>
      </tr>
      <tr>
       <td colspan="6" class="situation" style="width:964px;height:17px;background-image: url('img/SITUATION.gif');">
       Vous êtes ici : <a href="index.htm" class="situation_on">Accueil</a></td>
      </tr>
      <tr>
       <td colspan="6" style="width:964px;height:10px;background-image: url('img/B1.gif');"></td>
      </tr>
      <tr>
       <td rowspan="3" style="width:10px;height:446px;background-image: url('img/B3.gif');"></td>
       <td rowspan="3" style="width:563px;height:406px;background-image: url('img/CONTENU.gif');"><div id="contenu_gauche">
         <p class="contenu_gauche_titre">Bienvenue sur Arcotec.fr</p>
    	 <?
    session_start();
    if (isset ($_POST['login']))
     
    echo '<p class="contenu_gauche_texte">';
    echo 'bonjour ' .$_SESSION['login'];
    ?>
    merci pour votre aide!

  2. #2
    Modératrice
    Avatar de Celira
    Femme Profil pro
    Développeuse PHP/Java
    Inscrit en
    Avril 2007
    Messages
    8 633
    Détails du profil
    Informations personnelles :
    Sexe : Femme
    Âge : 39
    Localisation : France

    Informations professionnelles :
    Activité : Développeuse PHP/Java
    Secteur : Industrie

    Informations forums :
    Inscription : Avril 2007
    Messages : 8 633
    Points : 16 372
    Points
    16 372
    Modératrice PHP
    Aucun navigateur ne propose d'extension boule-de-cristal : postez votre code et vos messages d'erreurs. (Rappel : "ça ne marche pas" n'est pas un message d'erreur)
    Cherchez un peu avant poser votre question : Cours et Tutoriels PHP - FAQ PHP - PDO une soupe et au lit !.

    Affichez votre code en couleurs : [CODE=php][/CODE] (bouton # de l'éditeur) et [C=php][/C]

  3. #3
    Nouveau membre du Club
    Profil pro
    Inscrit en
    Octobre 2005
    Messages
    106
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Octobre 2005
    Messages : 106
    Points : 37
    Points
    37
    Par défaut
    merci beaucoup,

    c'est bon le problème est resolu

    je mets le code correct

    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
     
    <?
    session_start();
    ?>
    <!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">
     
    <head>
     
    <title>Arcotec | Accueil</title>
    	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    	<meta name="Description" content="Description..." />
    	<meta name="Keywords" content="Mots clés..." />
    	<link href="css/page.css" rel="stylesheet" type="text/css" />
     
    <style type="text/css">
    body {
    	background-image: url(img/FOND.gif);
    	margin-left: 0px;
    	margin-top: 0px;
    	margin-right: 0px;
    	margin-bottom: 0px;
    }
    </style>
     
    </head>
     
    <body bgcolor="#ffffff">
    <table style="text-align:left;border-width:0px;width:994px;" cellpadding="0" cellspacing="0">
      <tr>
       <td colspan="3"><img src="img/LOGO.gif" id="Logo" alt="Arcotec | Normes et Sécurités" style="width:628px;height:76px;"/></td>
       <td colspan="5"><img src="img/SLOGAN.gif" id="Slogan" alt="La plus belle réussite, votre confiance..." style="width:366px;height:76px;"/></td>
      </tr>
      <tr>
       <td colspan="8" style="width:994px;height:10px;background-image: url('img/A1.png');"></td>
      </tr>
      <tr>
       <td rowspan="7" style="width:15px;height:518px;background-image: url('img/A3.png');"></td>
       <td colspan="6" class="navigation" style="width:964px;height:35px;background-image: url('img/NAVIGATION.gif');">
       <a href="index.htm" class="navigation_on">Accueil</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
       <a href="catalogue.htm" class="navigation_on">Catalogue</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
       <a href="nouveautes.htm" class="navigation_on">Nouveautés</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
       <a href="engagements.htm" class="navigation_on">Nos engagements</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
       <a href="entreprises.htm" class="navigation_on">Espace client</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
       <a href="contact.htm" class="navigation_on">Nous contacter</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
       <a href="plan.htm" class="navigation_on">Plan d'accès</a></td>
       <td rowspan="7" style="width:15px;height:518px;background-image: url('img/A4.png');"></td>
      </tr>
      <tr>
       <td colspan="6" class="situation" style="width:964px;height:17px;background-image: url('img/SITUATION.gif');">
       Vous êtes ici : <a href="index.htm" class="situation_on">Accueil</a></td>
      </tr>
      <tr>
       <td colspan="6" style="width:964px;height:10px;background-image: url('img/B1.gif');"></td>
      </tr>
      <tr>
       <td rowspan="3" style="width:10px;height:446px;background-image: url('img/B3.gif');"></td>
       <td rowspan="3" style="width:563px;height:406px;background-image: url('img/CONTENU.gif');"><div id="contenu_gauche">
    <?
    if (isset ($_POST['login']))
     
    echo '<p class="contenu_gauche_texte">';
    echo 'bonjour ' .$_SESSION['login'];
    ?>
    merci encore

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

Discussions similaires

  1. Réponses: 9
    Dernier message: 14/01/2016, 23h20
  2. Cannot send session cache limiter - headers already sent
    Par lea.soineca dans le forum Langage
    Réponses: 2
    Dernier message: 14/03/2014, 14h06
  3. session_start() : Cannot send session cache limiter - headers already sent
    Par Keweed dans le forum PHP & Base de données
    Réponses: 2
    Dernier message: 30/09/2009, 10h14
  4. Réponses: 10
    Dernier message: 19/06/2008, 14h27
  5. une session folle ! (headers already sent ...)
    Par php4life dans le forum Langage
    Réponses: 1
    Dernier message: 27/01/2007, 16h19

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