Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Header already sent ERROR MSG!

Status
Not open for further replies.

Sitehelp

Technical User
Joined
Feb 4, 2004
Messages
142
Location
GB
Would using a session and HTTP_POST_VARS at the same time create the following error message? if not I am stuck what is...

Warning: Cannot add header information - headers already sent by (output started at c:\apache\htdocs\project\user logged in\calls\callinformationstep2.php:6) in c:\apache\htdocs\project\user logged in\calls\callinformationstep2.php on line 93

line 93 is:

header(sprintf("Location: %s", $insertGoTo));

I am trying to post a form into a row in my DB and then on the next page it tells you what you entered by retreiving the data from the HTTP_POST_VARS, this has worked with other things in the past but not now? any ideas all????



 
Cheers, however, I am still receiving an error, I have had this code working in the past but since some modification, which I have no longer got an original copy, I cannot get it working, it all seems correct! my code is as follows:

if ((isset($HTTP_POST_VARS["MM_insert"])) && ($HTTP_POST_VARS["MM_insert"] == "form1")) {
$insertSQL = sprintf("INSERT INTO callinfo (ClientID, `Call Description`, CallDateandTime, `Call Header`, Priority) VALUES (%s, %s, %s, %s, %s)",
GetSQLValueString($HTTP_POST_VARS['ClientID'], "text"),
GetSQLValueString($HTTP_POST_VARS['Call_Description'], "text"),
GetSQLValueString($HTTP_POST_VARS['calldateandtime'], "text"),
GetSQLValueString($HTTP_POST_VARS['Call_Header'], "text"),
GetSQLValueString($HTTP_POST_VARS['Priority'], "text"));

mysql_select_db($database_MARTIN, $MARTIN);
$Result1 = mysql_query($insertSQL, $MARTIN) or die(mysql_error());

$insertGoTo = " Logged In/Calls/CallComplete.php";
if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) {
$insertGoTo .= (strpos($insertGoTo, '?')) ? "&" : "?";
$insertGoTo .= $HTTP_SERVER_VARS['QUERY_STRING'];
}
header(sprintf("Location: %s", $insertGoTo));
}

mysql_select_db($database_MARTIN, $MARTIN);
$query_ClientInfo = "SELECT * FROM clientinfo WHERE clientinfo.ClientID = '$ClientID'";
$ClientInfo = mysql_query($query_ClientInfo, $MARTIN) or die(mysql_error());
$row_ClientInfo = mysql_fetch_assoc($ClientInfo);
$totalRows_ClientInfo = mysql_num_rows($ClientInfo);
?>

Any ideas as I am confused now! Cheers for this as this is the last piece of the jigsaw of my site! cheers!
 
All I have is some PHP script to generate the date in the form, PHP IF statement to print some text on condition to another box (value of which would have been inputted on the previous page and then copied over to this form. After this come the text I have written above, then the form is written where data is automatically entered from recognition of the user from the session variable and a box for the user to enter some data which can be submitted on clicking submit. Would all this possibly cause this error somewhere. I am not quite sure what you mean by manipulate headers if your script has produced an output? ta!
 
cheers mate sorry just read it wrong all is great now! ta
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top