Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New Coder
    Join Date
    Feb 2005
    Posts
    11
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Warning: Cannot modify header information

    Afternoon,

    I've removed every, allright I guess not every, bit of white space I could find. If someone could take a quick look and tell me if they see anything that would be great....

    Code:
    session_start();
    header("Cache-control: private"); //IE 6 Fix
    include ("connect.php");
    $Nickname = $_POST['Nickname'];
    $Sex = $_POST['Sex'];
    $Major = $_POST['Major'];
    $Residence_Hall = $_POST['Residence_Hall'];
    $Room = $_POST['Room'];
    $Campus_Phone = $_POST['Campus_Phone'];
    $Cell_Phone = $_POST['Cell_Phone'];
    $Email = $_POST['Email'];
    $Ethnicity = $_POST['Ethnicity'];
    $Privacy_Flag = $_POST['Privacy_Flag'];
    $query = "INSERT INTO PersonTbl (CampusID,Nickname,Sex,Major,Residence_Hall,Room,Campus_Phone,Cell_Phone,Email,Ethnicity,Privacy_Flag)VALUES ('" .$_SESSION['Campus_ID'] . "','" . $Nickname . "','" . $Sex . "','" . $Major . "','" . $Residence_Hall . "','" . $Room . "','" .$Campus_Phone . "','" . $Cell_Phone . "','" . $Email . "','" . $Ethnicity . "','" . $Privacy_Flag . "')";
    header("Location: Academic.php");
    and the include file

    Code:
    $database='Res_Life_Dev'; 
    $link=mysql_connect('localhost','username','xxxxxx');
    $connection=mysql_select_db($database,$link);
    Thanks for any help

    Laura

  • #2
    Senior Coder
    Join Date
    Jul 2005
    Location
    New York, NY
    Posts
    1,084
    Thanks
    4
    Thanked 19 Times in 19 Posts
    Any output whatsoever prior to the session_start will cause this. Is this file being included somewhere? Any echo's any errors, anything that happens prior to session_start being called will cause this.

  • #3
    New to the CF scene
    Join Date
    Jun 2006
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts
    If I remove the

    Code:
    include ("connect.php");
    line and imbed the following in the page then it works perfectly. The only thing in that connect.php is this:

    Code:
    $database='Res_Life_Dev'; 
    $link=mysql_connect('localhost','username','xxxxxx');
    $connection=mysql_select_db($database,$link);
    Obviously I dont want to do that since I'm working in Dev and will have to move to live at some point and dont want to edit a 100 files
    Last edited by lmayer4; 09-01-2006 at 10:00 PM. Reason: spelled wrong.

  • #4
    Senior Coder
    Join Date
    Jul 2005
    Location
    New York, NY
    Posts
    1,084
    Thanks
    4
    Thanked 19 Times in 19 Posts
    start the session before the include.

  • #5
    Rockstar Coder
    Join Date
    Jun 2002
    Location
    USA
    Posts
    9,074
    Thanks
    1
    Thanked 328 Times in 324 Posts
    Do you have any white space in that include then?
    OracleGuy

  • #6
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Location
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Posts
    7,691
    Thanks
    42
    Thanked 637 Times in 625 Posts
    Put ob_start() just after the session_start() and whitespace won't matter.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •