Strange output error

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Stijn Goris

    Strange output error

    hi all,

    I have this strange error: when I need to use the database on a page I
    include connectionDB.ph p with inculde_once("c onnectionDB.php ");
    The connectionDB.ph p looks like this:

    <?
    $db = mysql_connect(" localhost", "xxxxxx, "xxxxxx");
    mysql_select_db ("xxxxx",$db );
    ?>

    when I use the header("Locatio n: goto.php"); function after the
    connectionDB.ph p code is included I get
    Warning: Cannot modify header information - headers already sent by (output
    started at C:\Inetpub\webp ub\S11Mate\html 01\connectionDB .php:4) in
    C:\Inetpub\webp ub\S11Mate\html 01\login.php on line 60

    This means that connectionDB.ph p is sending to the browser? Being more
    specific, line number 4, ?> . Someone knowswhats going wrong.

    kind regards
    Stijn


  • Pedro

    #2
    Re: Strange output error

    Stijn Goris wrote:
    [...][color=blue]
    > The connectionDB.ph p looks like this:
    >
    ><?
    > $db = mysql_connect(" localhost", "xxxxxx, "xxxxxx");
    > mysql_select_db ("xxxxx",$db );
    > ?>[/color]
    ____^_

    maybe a space there?

    --
    I have a spam filter working.
    To mail me include "urkxvq" (with or without the quotes)
    in the subject line, or your mail will be ruthlessly discarded.

    Comment

    • Stijn Goris

      #3
      Re: Strange output error


      "Pedro" <hexkid@hotpop. com> wrote in message
      news:bl1lia$775 i1$1@ID-203069.news.uni-berlin.de...[color=blue]
      > Stijn Goris wrote:
      > [...][color=green]
      > > The connectionDB.ph p looks like this:
      > >
      > ><?
      > > $db = mysql_connect(" localhost", "xxxxxx, "xxxxxx");
      > > mysql_select_db ("xxxxx",$db );
      > > ?>[/color]
      > ____^_
      >
      > maybe a space there?
      >
      > --
      > I have a spam filter working.
      > To mail me include "urkxvq" (with or without the quotes)
      > in the subject line, or your mail will be ruthlessly discarded.[/color]

      I don't think a space can cause the error. I put spaces and tabs all around
      my code to make it better looking.

      But the problem has disapeared for some reason.

      regards


      Comment

      • Ian.H

        #4
        Re: Strange output error

        On Fri, 26 Sep 2003 18:53:14 +0200, Stijn Goris wrote:
        [color=blue]
        >
        > "Pedro" <hexkid@hotpop. com> wrote in message
        > news:bl1lia$775 i1$1@ID-203069.news.uni-berlin.de...[color=green]
        >> Stijn Goris wrote:
        >> [...][color=darkred]
        >> > The connectionDB.ph p looks like this:
        >> >
        >> ><?
        >> > $db = mysql_connect(" localhost", "xxxxxx, "xxxxxx");
        >> > mysql_select_db ("xxxxx",$db );
        >> > ?>[/color]
        >> ____^_
        >>
        >> maybe a space there?
        >>
        >> --
        >> I have a spam filter working.
        >> To mail me include "urkxvq" (with or without the quotes) in the subject
        >> line, or your mail will be ruthlessly discarded.[/color]
        >
        > I don't think a space can cause the error. I put spaces and tabs all
        > around my code to make it better looking.[/color]


        The space in this case _would_ matter, as this would be sent as "text" to
        the browser more than likely before another header call. I fell prey to
        this the other day with a script after I insterted a blank line after the
        closing '?>' chars. This was in the header section with more header code
        below.. and threw the same error your script has done. Removing the blank
        line fixed the problem instantly. Tabs / spaces within the <?php ?> tags
        are neither here nor there =)



        Regards,

        Ian

        --
        Ian.H [Design & Development]
        digiServ Network - Web solutions
        www.digiserv.net | irc.digiserv.ne t | forum.digiserv. net
        Programming, Web design, development & hosting.

        Comment

        • Stijn Goris

          #5
          Re: Strange output error


          "Ian.H" <ian@WINDOZEdig iserv.net> wrote in message
          news:pan.2003.0 9.26.15.42.16.6 69873@hybris.di giserv.net...[color=blue]
          > On Fri, 26 Sep 2003 18:53:14 +0200, Stijn Goris wrote:
          >[color=green]
          > >
          > > "Pedro" <hexkid@hotpop. com> wrote in message
          > > news:bl1lia$775 i1$1@ID-203069.news.uni-berlin.de...[color=darkred]
          > >> Stijn Goris wrote:
          > >> [...]
          > >> > The connectionDB.ph p looks like this:
          > >> >
          > >> ><?
          > >> > $db = mysql_connect(" localhost", "xxxxxx, "xxxxxx");
          > >> > mysql_select_db ("xxxxx",$db );
          > >> > ?>
          > >> ____^_
          > >>
          > >> maybe a space there?
          > >>
          > >> --
          > >> I have a spam filter working.
          > >> To mail me include "urkxvq" (with or without the quotes) in the subject
          > >> line, or your mail will be ruthlessly discarded.[/color]
          > >
          > > I don't think a space can cause the error. I put spaces and tabs all
          > > around my code to make it better looking.[/color]
          >
          >
          > The space in this case _would_ matter, as this would be sent as "text" to
          > the browser more than likely before another header call. I fell prey to
          > this the other day with a script after I insterted a blank line after the
          > closing '?>' chars. This was in the header section with more header code
          > below.. and threw the same error your script has done. Removing the blank
          > line fixed the problem instantly. Tabs / spaces within the <?php ?> tags
          > are neither here nor there =)
          >
          >
          >
          > Regards,
          >
          > Ian
          >
          > --
          > Ian.H [Design & Development]
          > digiServ Network - Web solutions
          > www.digiserv.net | irc.digiserv.ne t | forum.digiserv. net
          > Programming, Web design, development & hosting.
          >[/color]

          Thanks, that makes sence... after the ?> .

          kind regards and and great thanks for the help
          Stijn


          Comment

          • Pedro

            #6
            Re: Strange output error

            Stijn Goris wrote:[color=blue]
            >
            > "Pedro" <hexkid@hotpop. com> wrote in message
            > news:bl1lia$775 i1$1@ID-203069.news.uni-berlin.de...[color=green]
            >> Stijn Goris wrote:
            >> [...][color=darkred]
            >> > The connectionDB.ph p looks like this:
            >> >
            >> ><?
            >> > $db = mysql_connect(" localhost", "xxxxxx, "xxxxxx");
            >> > mysql_select_db ("xxxxx",$db );
            >> > ?>[/color]
            >> ____^_
            >>
            >> maybe a space there?[/color]
            > I don't think a space can cause the error. I put spaces and tabs all around
            > my code to make it better looking.
            >
            > But the problem has disapeared for some reason.[/color]

            I tested a file with a space after the closing "?>" and I got that
            error. My editor strips trailing spaces on save, so I had to reconfigure
            it to be able to test :-)
            Of course it's now back to the previous configuration.

            --
            I have a spam filter working.
            To mail me include "urkxvq" (with or without the quotes)
            in the subject line, or your mail will be ruthlessly discarded.

            Comment

            • Yves Brault

              #7
              Re: Strange output error

              Once you got your the error on your browser, did you try to view the source
              by clicking the "Source" option from the "View" menu (if you're using
              Internet Explorer).

              You'll probalby see another error message related to your mysql_connect() or
              mysql_db() command.

              I guess you have a connection error...


              "Pedro" <hexkid@hotpop. com> wrote in message
              news:bl1nnv$6qk m5$2@ID-203069.news.uni-berlin.de...[color=blue]
              > Stijn Goris wrote:[color=green]
              > >
              > > "Pedro" <hexkid@hotpop. com> wrote in message
              > > news:bl1lia$775 i1$1@ID-203069.news.uni-berlin.de...[color=darkred]
              > >> Stijn Goris wrote:
              > >> [...]
              > >> > The connectionDB.ph p looks like this:
              > >> >
              > >> ><?
              > >> > $db = mysql_connect(" localhost", "xxxxxx, "xxxxxx");
              > >> > mysql_select_db ("xxxxx",$db );
              > >> > ?>
              > >> ____^_
              > >>
              > >> maybe a space there?[/color]
              > > I don't think a space can cause the error. I put spaces and tabs all[/color][/color]
              around[color=blue][color=green]
              > > my code to make it better looking.
              > >
              > > But the problem has disapeared for some reason.[/color]
              >
              > I tested a file with a space after the closing "?>" and I got that
              > error. My editor strips trailing spaces on save, so I had to reconfigure
              > it to be able to test :-)
              > Of course it's now back to the previous configuration.
              >
              > --
              > I have a spam filter working.
              > To mail me include "urkxvq" (with or without the quotes)
              > in the subject line, or your mail will be ruthlessly discarded.[/color]


              Comment

              Working...