...

View Full Version : Warning: Cannot modify header information



lmayer
09-01-2006, 08:52 PM
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....



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_Fla g)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



$database='Res_Life_Dev';
$link=mysql_connect('localhost','username','xxxxxx');
$connection=mysql_select_db($database,$link);


Thanks for any help

Laura

Beagle
09-01-2006, 08:55 PM
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.

lmayer4
09-01-2006, 08:59 PM
If I remove the



include ("connect.php");


line and imbed the following in the page then it works perfectly. The only thing in that connect.php is this:



$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 :)

Beagle
09-01-2006, 09:22 PM
start the session before the include.

oracleguy
09-01-2006, 09:44 PM
Do you have any white space in that include then?

Fumigator
09-02-2006, 06:04 AM
Put ob_start() just after the session_start() and whitespace won't matter.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum