Menu

Header error

llew
2001-09-23
2001-09-29
  • llew

    llew - 2001-09-23

    Guys,

    I am getting the following error

    Warning: Cannot add header information - headers already sent by (output started at /www/empris/dbconnect.php:46) in /www/empris/index.php on line 28

    Line 46 of my modified dbconnect is
    $TABLEHEADERCOLOUR = "#99CC00";
    define('DEBUG',0);
    (PS the is not a connection to the database problem, I now have the connection as I have modified the files)

     
    • Adam Thomas

      Adam Thomas - 2001-09-25

      For some reason dbconnect.php is producing output,  which is shouldn't be doing. What appears before the warning message? Can you post the full tex of dbconnect.php?

      cheers,
      -Adam Thomas

       
    • llew

      llew - 2001-09-26

      Here is the scipt, the changes where mande to get the dbconnect.php file to connect.

      You will notice that the first part of the file reflects what is in the global.php (I have not removed this from the global.php
      _______________________________________________

      <?
      /*
      * Empris
      *
      *  Copyright (C) 2001 Adam G. Thomas
      *  Oxfam Community Aid Abroad Australia
      *
      *  adamt@caa.org.au
      *
      *  This program is free software; you can redistribute it and/or modify
      *  it under the terms of the The Artistic License as published at
      http://www.opensource.org/licenses/artistic-license.html
      *
      *  This program is distributed in the hope that it will be useful,
      *  but WITHOUT ANY WARRANTY; without even the implied warranty of
      *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
      *  GNU General Public License for more details.
      *
      *  You should have received a copy of the Artistic License
      *  along with this program; if not, visit the above URL.
      */

      if (!ereg( "[4-9]\.[0-9]\.[5-9].*", phpversion() )){
        if (ereg( "[4-9]\.[0-9]\.[4].*", phpversion() )){
        echo "Your PHP version  is ".phpversion()."<BR> I've gotten Empris to work with this version by copying the PEAR libraries from version 4.0.5+ and setting  the include path to find them. Give it a shot if you know what you're doing but it's probably easier to just upgade to 4.0.5+<BR>";
        exit();
        } else {
        echo "Your PHP version  is ".phpversion()." so there is not much hope of Empris working. Please upgrade to 4.0.5+ and try again.<BR>";
        exit();
        }
      }
      $DB = "*****";
      $dbhost = '************';
      $dbuser = '*************';
      $dbpass = '******';
      $dbname = '*****************';
      DEFINE(EMPRIS_ROOT,"http://www.***********.com/empris");
      $phormationdir = "./phormation";
      $TABLEHEADERCOLOUR = "#99CC00";
      define('DEBUG',0);

      //include_path= ( "/usr/local/lib/php" );
      require_once( "DB.php" );
      $conn = DB::connect( "$DB://$dbuser:$dbpass@$dbhost/$dbname" );

      if ($conn) echo "Got Connection!";
      if (DB::isError($conn)) {
        echo "DB:iserror = true<BR>";
        die ($conn->getMessage());
      }
      ?>
      ___________________________________________

      thanks for the help

      Llew

       
      • Adam Thomas

        Adam Thomas - 2001-09-26

        Your problem is probably with this echo statement:

        if ($conn) echo "Got Connection!";

        The headers sent by index.php have to be the very first thing printed, otherwise it will produce an ill formed web page. Comment out the echo statement as see if that helps.

        -Adam Thomas

         
    • llew

      llew - 2001-09-29

      Thanks Adam,

      if I remove got connection, it works. I have successfull installed this programe with your help.

      Regards

      Llew

       
      • Adam Thomas

        Adam Thomas - 2001-09-29

        Glad to hear it Llew. Please keep me posted on how it works for you, what you like and don't like, etc. Empris has been downloaded by over 400 people but I've no idea how many of those people are actively using it or what their experiences have been. At this point in development feedback from users is very valuable. So thanks for all your questions and comments and please keep them coming!

        cheers,
        -Adam Thomas

         

Log in to post a comment.

MongoDB Logo MongoDB