Visualizzazione dei risultati da 1 a 5 su 5
  1. #1

    Cannot modify header information..

    Ok, quello citato nel titolo è un errore frequente, dovuto magari al posizionamento errato di session_start() o a spazi che precedono la funzione.. ma nel mio caso mi dice che l' header è già iniziato da un file css.. Come è possibile? Il file è tutto codici css, la pagina in cui compare l' errore header è la seguente (ho lasciato solo i codici importanti):

    Codice PHP:
    <?php
    /*---------------------------------------------------+
    | MyBeatCMS - Powered by zypp0
    +----------------------------------------------------+
    | Copyright © 2011 Zypp0 & Meth0d
    +---------------------------------------------------*/
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
            "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <title>MyBeat ~ Registrazione</title>
    <link rel="stylesheet" href="http://images.habbo.com/habboweb/63_1dc60c6d6ea6e089c6893ab4e0541ee0/572/web-gallery/static/styles/common.css" type="text/css" />
    <script src="http://images.habbo.com/habboweb/63_1dc60c6d6ea6e089c6893ab4e0541ee0/572/web-gallery/static/js/libs2.js" type="text/javascript"></script>
    <script src="http://images.habbo.com/habboweb/63_1dc60c6d6ea6e089c6893ab4e0541ee0/572/web-gallery/static/js/visual.js" type="text/javascript"></script>
    <script src="http://images.habbo.com/habboweb/63_1dc60c6d6ea6e089c6893ab4e0541ee0/572/web-gallery/static/js/libs.js" type="text/javascript"></script>
    <script src="http://images.habbo.com/habboweb/63_1dc60c6d6ea6e089c6893ab4e0541ee0/572/web-gallery/static/js/common.js" type="text/javascript"></script>
    <link rel="stylesheet" href="http://images.habbo.com/habboweb/63_1dc60c6d6ea6e089c6893ab4e0541ee0/572/web-gallery/static/styles/quickregister.css" type="text/css" />
    <script src="http://images.habbo.com/habboweb/63_1dc60c6d6ea6e089c6893ab4e0541ee0/572/web-gallery/static/js/quickregister.js" type="text/javascript"></script>
    <script src="http://www.html.it/guide/esempi/jquery/esempi/jquery-1.3.2.js" type="text/javascript"></script>
    <style type="text/css">
    .avanti_submit {
    background: url(web-gallery/v2/images/avanti_submit.png); 
    border: none; 
    width: 132px; 
    height: 50px;
    cursor: pointer;
    }

    .avanti_submit:hover {
    background: url(web-gallery/v2/images/avanti_submit_hover.png); 
    }

    .fatto_submit {
    background: url(web-gallery/v2/images/fatto_submit.png); 
    border: none; 
    width: 90px; 
    height: 50px;
    cursor: pointer;
    }

    .fatto_submit:hover {
    background: url(web-gallery/v2/images/fatto_submit_hover.png); 
    }
    </style>
    <script type="text/javascript">
    document.habboLoggedIn = false;
    var habboName = null;
    var habboReqPath = "";
    var habboStaticFilePath = "./web-gallery";
    var habboImagerUrl = "/habbo-imaging/";
    var habboPartner = "";
    window.name = "habboMain";

    </script>

    <!--[if lt IE 8]>
    <link rel="stylesheet" href="./web-gallery/v2/styles/ie.css" type="text/css" />
    <![endif]-->
    <!--[if lt IE 7]>
    <link rel="stylesheet" href="./web-gallery/v2/styles/ie6.css" type="text/css" />
    <script src="./web-gallery/static/js/pngfix.js" type="text/javascript"></script>
    <script type="text/javascript">
    try { document.execCommand('BackgroundImageCache', false, true); } catch(e) {}
    </script>

    <style type="text/css">
    body { behavior: url(./web-gallery/csshover.htc); }
    </style>
    <![endif]-->
    <meta name="build" content="9.0.47 - Login Template - HoloCMS" />
    </head>
    <body id="client" class="background-agegate">
    <div id="overlay"></div>
    <p class="phishing-warning">Questa schermata serve a proteggere i tuoi dati di accesso dai tentativi di furto. Assicurati che l'indirizzo della pagina web cominci con [url]http://[/url]<?php echo $config['ip']; ?>/ e chiudi la finestra se vedi indirizzi diversi!</p>
    <?php

    if(!is_numeric($step)) { $step 1; }

    $step = (htmlspecialchars($_GET['step'])) ? $_GET['step'] : 1;

    switch(
    $step) {
    case 
    1:
    $error false;
    if(isset(
    $_POST['submit-1'])) {
        
    $giorno $_POST['giorno'];
        
    $mese $_POST['mese'];
        
    $anno $_POST['anno'];
        
    $genere $_POST['genere'];
        
        if(empty(
    $giorno) || empty($mese) || empty($anno)) {
        
    $error true;
        } else {
        
    $data $giorno.'-'.$mese.'-'.$anno;
        
    $_SESSION['data'] = $data;
        
    $_SESSION['genere'] = $genere;
    header('Location: register.php?step=2');
        }
    }
    ?>


    <div id="main-container">
    <?php if($error === true) { ?>
           
    <?php } else { echo '<div id="error-placeholder"></div>'; } ?>

    <form action="register.php?step=1" name="step1" method="POST">
            <div id="title">
                Data di nascita e sesso
            </div>

     
            <input type="submit" name="submit-1" class="avanti_submit" value="" />
            </div>
        </div>
        </form>
        </div>
    break;
    }
    ?>

    </body>
    </html>
    Quindi diciamo che i codici sono molto semplici, l' errore generato (solo 3 step, ne ho messa solo una, per spostarmi da una step all' altra uso header location):

    Warning: Cannot modify header information - headers already sent by (output started at /home/mybeat.it/public_html/register/register.php:14) in /home/mybeat.it/public_html/register/register.php on line 113

    Linea 113 è la linea dell' header location alla step2, la linea 14 è la prima inclusione css, ovvero:

    codice:
    <link rel="stylesheet" href="http://images.habbo.com/habboweb/63_1dc60c6d6ea6e089c6893ab4e0541ee0/572/web-gallery/static/styles/common.css" type="text/css" />
    Come è possibile che questo sia un output?
    Social Network in costruzione.. Misto tra Twitter e Facebook.. Twitbook o facetter?

  2. #2
    Tutto questo:

    codice:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
            "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
    <head>
    <meta http-equiv="content-type" content="text/html; charset=utf-8" />
    <title>MyBeat ~ Registrazione</title>
    <link rel="stylesheet" href="http://images.habbo.com/habboweb/63_1dc60c6d6ea6e089c6893ab4e0541ee0/572/web-gallery/static/styles/common.css" type="text/css" />
    <script src="http://images.habbo.com/habboweb/63_1dc60c6d6ea6e089c6893ab4e0541ee0/572/web-gallery/static/js/libs2.js" type="text/javascript"></script>
    <script src="http://images.habbo.com/habboweb/63_1dc60c6d6ea6e089c6893ab4e0541ee0/572/web-gallery/static/js/visual.js" type="text/javascript"></script>
    <script src="http://images.habbo.com/habboweb/63_1dc60c6d6ea6e089c6893ab4e0541ee0/572/web-gallery/static/js/libs.js" type="text/javascript"></script>
    <script src="http://images.habbo.com/habboweb/63_1dc60c6d6ea6e089c6893ab4e0541ee0/572/web-gallery/static/js/common.js" type="text/javascript"></script>
    <link rel="stylesheet" href="http://images.habbo.com/habboweb/63_1dc60c6d6ea6e089c6893ab4e0541ee0/572/web-gallery/static/styles/quickregister.css" type="text/css" />
    <script src="http://images.habbo.com/habboweb/63_1dc60c6d6ea6e089c6893ab4e0541ee0/572/web-gallery/static/js/quickregister.js" type="text/javascript"></script>
    <script src="http://www.html.it/guide/esempi/jquery/esempi/jquery-1.3.2.js" type="text/javascript"></script>
    <style type="text/css">
    .avanti_submit {
    background: url(web-gallery/v2/images/avanti_submit.png); 
    border: none; 
    width: 132px; 
    height: 50px;
    cursor: pointer;
    }
    
    .avanti_submit:hover {
    background: url(web-gallery/v2/images/avanti_submit_hover.png); 
    }
    
    .fatto_submit {
    background: url(web-gallery/v2/images/fatto_submit.png); 
    border: none; 
    width: 90px; 
    height: 50px;
    cursor: pointer;
    }
    
    .fatto_submit:hover {
    background: url(web-gallery/v2/images/fatto_submit_hover.png); 
    }
    </style>
    <script type="text/javascript">
    document.habboLoggedIn = false;
    var habboName = null;
    var habboReqPath = "";
    var habboStaticFilePath = "./web-gallery";
    var habboImagerUrl = "/habbo-imaging/";
    var habboPartner = "";
    window.name = "habboMain";
    
    </script>
    
    <!--[if lt IE 8]>
    <link rel="stylesheet" href="./web-gallery/v2/styles/ie.css" type="text/css" />
    <![endif]-->
    <!--[if lt IE 7]>
    <link rel="stylesheet" href="./web-gallery/v2/styles/ie6.css" type="text/css" />
    <script src="./web-gallery/static/js/pngfix.js" type="text/javascript"></script>
    <script type="text/javascript">
    try { document.execCommand('BackgroundImageCache', false, true); } catch(e) {}
    </script>
    
    <style type="text/css">
    body { behavior: url(./web-gallery/csshover.htc); }
    </style>
    <![endif]-->
    <meta name="build" content="9.0.47 - Login Template - HoloCMS" />
    </head>
    <body id="client" class="background-agegate">
    <div id="overlay"></div>
    <p class="phishing-warning">Questa schermata serve a proteggere i tuoi dati di accesso dai tentativi di furto. Assicurati che l'indirizzo della pagina web cominci con http://<?php echo $config['ip']; ?>/ e chiudi la finestra se vedi indirizzi diversi!</p>
    
    ...
    secondo te cos'è? Non è un output?
    "Mai discutere con un idiota. Ti trascina al suo livello e ti batte con l'esperienza." (Oscar Wilde)

  3. #3
    Fino alle inclusioni dei file avrei detto di no, forse dopo sì, ma non vedo nessun output che comunque potrebbe ostacolare l' header, se fossero questi gli output "ostacolanti" non ci sarebbe layout a nessuno script php.
    Social Network in costruzione.. Misto tra Twitter e Facebook.. Twitbook o facetter?

  4. #4
    Mi sa che hai le idee confuse. Che differenza credi ci sia tra:

    Codice PHP:
    Prova output

    <?php
    ...
    ?>
    e

    Codice PHP:
    <?php
    echo "Prova output";

    ...
    ?>
    Entrambi genereranno una pagina con la scritta "Prova output".
    "Mai discutere con un idiota. Ti trascina al suo livello e ti batte con l'esperienza." (Oscar Wilde)

  5. #5
    Quello ovvio che lo so, ma cosa ha di OUTPUT un file css? Dimmelo tu. Al massimo l' output è ciò che viene collegato a questo file, tramite id o class.
    Social Network in costruzione.. Misto tra Twitter e Facebook.. Twitbook o facetter?

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.