+ Reply to Thread
Results 1 to 9 of 9

Thread: Need Help a Warning

  1. #1
    imrocker is offline x10Hosting Member imrocker is an unknown quantity at this point
    Join Date
    Feb 2009
    Posts
    5

    Unhappy Need Help a Warning

    Warning: Cannot modify header information - headers already sent by (output started at /home/imrocker/public_html/index.php:1) in /home/imrocker/public_html/index.php on line 2

    im new in this hosting in the another host all my web are nice... nothing bad
    but when i upload again all mypage i see that error i hope what you can help me

    you can see the error here
    http://www.imrocker.es/
    i really dont know never happend it to me
    :dunno: i try to fix the errors but say me a syntasyx error :S


    need ur help

  2. #2
    xPlozion's Avatar
    xPlozion is offline x10 Elder xPlozion is an unknown quantity at this point
    Join Date
    Mar 2008
    Location
    Delaware, USA
    Posts
    872

    Re: Need Help a Warning

    What's on and around line 2? Chances are that you are either trying to set a cookie or use header(); _after_ text has already been sent to the browser (thus headers already sent).

    It could be as simple as just relocating the problem to the top of the script or using ob to capture any text that would otherwise be output and then set the contents to a variable and then show it after anything dealing with the headers have finished.

  3. #3
    gomarc's Avatar
    gomarc is offline x10 Elder gomarc is an unknown quantity at this point
    Join Date
    Oct 2007
    Location
    USA
    Posts
    511

    Re: Need Help a Warning

    Yes, as xPlozion said, that message means that something was sent to the browser before your line 2. The headers must be sent before anything else is sent to the browser.

    Maybe we can help if you post your first 2 lines of code.

  4. #4
    imrocker is offline x10Hosting Member imrocker is an unknown quantity at this point
    Join Date
    Feb 2009
    Posts
    5

    Re: Need Help a Warning

    PHP Code:
    <?
    header
    ("Cache-Control: no-store, no-cache, must-revalidate");
    include(
    'includes/config.php'); 
    ?>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xml:lang="es" xmlns="http://www.w3.org/1999/xhtml" lang="es">
    <head>
    <title><?=$title?></title>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <link rel="stylesheet" type="text/css" href="css/stylesheet.css">
        <style type="text/css">
    <!--
    .Estilo1 {color: #666666}
    .Estilo2 {color: #FF6600}
    .style1 {font-weight: bold}
    .Estilo4 {
     font-size: xx-small;
     color: #FFFFFF;
    }
    .Estilo6 {font-size: xx-small; color: #000000; }
    .Estilo9 {font-size: xx-small; color: #14181B; }
    -->
        </style>
    <script type="text/javascript" src="<?=$root ;?>/js/ajax.js"></script>
    <script type="text/javascript" src="<?=$root ;?>/js/jquery-min.js"></script>
    <script type="text/javascript" src="<?=$root ;?>/js/swfobject.js"></script>
    </head><body>
      <div id="mp3">
        <div id="cnenav"><strong>ImRocker!!™ Webpages Systems</strong>    <span class="Estilo6">Musica Gratis Musica Online</span></div> 
     
        <div id="global-header">
          <div class="logobar">
            <a href="http://www.<?=$site ;?>/" title="<?=$site ;?>" class="logo"><span><?=$site ;?></span></a>
            <div class="user"></div>
     
          </div>
      <div class="search">
        <div class="rubics_netxp1_main" id="rbx_netxp1_parent">
     <span class="xpromositename"></span>
     <img src="<?=$root ;?>/css/fab.gif" alt="Agregar a favoritos" width="13" height="11"> <a href="javascript:window.external.AddFavorite('http://www.<?=$site ;?>','<?=$site ;?> - <?=$slogan ;?>');" class="xpromolink">Agregar a favoritos</a> | 
     <img src="<?=$root ;?>/css/cs.gif" alt="Usar como página de inicio" width="13" height="11"> <a href="http://www.<?=$site ;?>/" onclick="this.style.behavior='url(#default#homepage)';this.setHomePage('http://www.<?=$site ;?>');return false" class="xpromolink">Usar como página de inicio</a>
    </div>
    <form action="buscador.php" method="get" onsubmit="javascript:return valida(this);">
                      <tr>
                        <td style="padding:5px; font-weight:normal; text-decoration:none; font-size:10px" align="center">
                          <input value="<?=$q;?>" size="40" name="q" />
                          <input type="submit" value="Buscar" />
                            <label><span class="Estilo2">
                            <input type="radio" name="j" value="1" />
                            </span></label>
                            <span class="Estilo2"> Cantante&nbsp;
                            <label>
                            <input type="radio" name="j" value="2"  />
                            </label>
    Canci&oacute;n&nbsp;
    <label>
    <input type="radio" name="j" value="3" checked="checked" />
    </label>
    Todo </span><br />
                          <label></label></td>
                      </tr>
          </form>
          </div>
     
            <div class="nav">
            </div>
        </div>
        <div id="global-subnav">               
      <ul>
        <li><a href="#" class="signup">Artistas por letra:</a></li><li><a href="<?=$root ;?>/Letra,a">A</a></li><li><a href="<?=$root ;?>/Letra,b">B</a></li><li><a href="<?=$root ;?>/Letra,c">C</a></li><li><a href="<?=$root ;?>/Letra,d">D</a></li><li><a href="<?=$root ;?>/Letra,e">E</a></li><li><a href="<?=$root ;?>/Letra,f">F</a></li><li><a href="<?=$root ;?>/Letra,g">G</a></li><li><a href="<?=$root ;?>/Letra,h">H</a></li><li><a href="<?=$root ;?>/Letra,i">I</a></li><li><a href="<?=$root ;?>/Letra,j">J</a></li><li><a href="<?=$root ;?>/Letra,k">K</a></li><li><a href="<?=$root ;?>/Letra,l">L</a></li><li><a href="<?=$root ;?>/Letra,m">M</a></li><li><a href="<?=$root ;?>/Letra,n">N</a></li>
     
     <li><a href="<?=$root ;?>/Letra,o">O</a></li><li><a href="<?=$root ;?>/Letra,p">P</a></li>
     
     <li><a href="<?=$root ;?>/Letra,q">Q</a></li><li><a href="<?=$root ;?>/Letra,r">R</a></li><li><a href="<?=$root ;?>/Letra,s">S</a></li><li><a href="<?=$root ;?>/Letra,t">T</a></li><li><a href="<?=$root ;?>/Letra,u">U</a></li><li><a href="<?=$root ;?>/Letra,v">V</a></li><li><a href="<?=$root ;?>/Letra,w">W</a></li><li><a href="<?=$root ;?>/Letra,x">X</a></li><li><a href="<?=$root ;?>/Letra,y">Y</a></li><li><a href="<?=$root ;?>/Letra,z">Z</a></li><li><a href="<?=$root ;?>/Letra,0">0-9</a></li>
      </ul>
        </div>
             <div id="superleader">
        </div>
        <div id="mp3-content">
    <div id="mpu-layout">
        <div id="main-col">
    this is the code php a little part of my index of a music webpage well i erase the line what call the includes/header.php
    and all is equal! say me it again... and no one page call the header :S

    i think what is a error whit this ?
    <?
    header
    ("Cache-Control: no-store, no-cache, must-revalidate"
    );
    include(
    'includes/config.php'
    );
    ?>

    but the config.php call the data base :S i dont know! u say what a part of the page call the header after... but not now... :S

  5. #5
    garrettroyce's Avatar
    garrettroyce is offline Generally Helpful Member garrettroyce is a glorious beacon of lightgarrettroyce is a glorious beacon of light
    Join Date
    Apr 2008
    Location
    IL, USA
    Posts
    3,746

    Re: Need Help a Warning

    I think I found the problem

    change all of these:
    Code:
    <?
    to this:
    Code:
    <?php
    gjr.gr - coming soon: secrets of OCD coding from a self taught tinkerer

  6. #6
    xPlozion's Avatar
    xPlozion is offline x10 Elder xPlozion is an unknown quantity at this point
    Join Date
    Mar 2008
    Location
    Delaware, USA
    Posts
    872

    Re: Need Help a Warning

    Short tags could be the problem, but only if the server doesn't support them. But then again, if they weren't enabled, then the PHP wouldn't execute.

    Is there any real purpose for the Cache-Control? You mentioned something about a header.php file. Seeing as how English isn't your native tongue, I couldn't make out your message clearly. Was the header.php file on line 2 or if not, then what line was it on?

  7. #7
    garrettroyce's Avatar
    garrettroyce is offline Generally Helpful Member garrettroyce is a glorious beacon of lightgarrettroyce is a glorious beacon of light
    Join Date
    Apr 2008
    Location
    IL, USA
    Posts
    3,746

    Re: Need Help a Warning

    I think it would have to be the short tags because the headers are sent on line 1.
    gjr.gr - coming soon: secrets of OCD coding from a self taught tinkerer

  8. #8
    xPlozion's Avatar
    xPlozion is offline x10 Elder xPlozion is an unknown quantity at this point
    Join Date
    Mar 2008
    Location
    Delaware, USA
    Posts
    872

    Re: Need Help a Warning

    And make sure to check that you don't have any spaces on the first line where the PHP tag is, as that will cause the error iirc ;)

    But try replacing <? with <?php . There's several reasons to do so: <? is also short-hand for XML, <? is being removed or disabled in future PHP versions 6.* iirc, and it's just plain lazy and frowned upon by the PHP community.

  9. #9
    imrocker is offline x10Hosting Member imrocker is an unknown quantity at this point
    Join Date
    Feb 2009
    Posts
    5

    Re: Need Help a Warning

    well thanks for ur help i have fix the error
    this is the cause

    <?
    header("Cache-Control: no-store, no-cache, must-revalidate");
    include('includes/config.php');
    ?>

    and letter

    include('header.php')

    have erase this part
    header("Cache-Control: no-store, no-cache, must-revalidate");


    beasue of it the page sent 2 times the header

    :-I

    well i dont know why the server tell me it if in my other hosting
    all work fine!


    ...

    now i have another problem my web is for mp3 online
    and my player dont call the music for my SQL db :S
    i dont know why...

    after fixing the error the player work fine..
    and now not!

    thanks all for your help

+ Reply to Thread

Similar Threads

  1. Replies: 14
    Last Post: 09-29-2008, 07:07 PM
  2. It works! ...
    By bpakidz in forum Programming Help
    Replies: 4
    Last Post: 09-07-2008, 11:12 PM
  3. New Site-Suggestions?
    By mnoutside in forum Review My Site
    Replies: 9
    Last Post: 08-27-2008, 07:01 AM
  4. GeIP Script Help
    By cybahq in forum Scripts & 3rd Party Apps
    Replies: 4
    Last Post: 07-30-2008, 06:19 AM
  5. GeIP Script Help
    By cybahq in forum Free Hosting
    Replies: 4
    Last Post: 07-30-2008, 05:08 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
x10hosting free hosting for the masses
dedicated servers