Cannot modify header information - headers already sent
I'm getting a similar problem as another thread, but no resolves helped any. Here's what I'm getting: (username removed with .x.x.)
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/.x.x./public_html/contact.php:1) in /home/.x.x./public_html/contact.php on line 25
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/.x.x./public_html/contact.php:1) in /home/.x.x./public_html/contact.php on line 25
Warning: Cannot modify header information - headers already sent by (output started at /home/.x.x./public_html/contact.php:1) in /home/.x.x./public_html/contact.php on line 34
The code at the top is really basic, just inserting one record from a form on the page to the DB with DataAssist Insert
----------------------------------
<?php require_once("Connections/.x.x.DB.php"); ?>
<?php require_once("WA_DataAssist/WA_AppBuilder_PHP.php"); ?>
<?php
// WA Application Builder Insert
if (isset($_POST["Submit"])) // Trigger
{
$WA_connection = $.x.x.DB;
$WA_table = "contact";
$WA_sessionName = "contact_cint";
$WA_redirectURL = "confirm.php";
$WA_keepQueryString = false;
$WA_indexField = "cint";
$WA_fieldNamesStr = "cname|cemail|ccity|cmessage|cpickedup";
$WA_fieldValuesStr = "".((isset($_POST["name"]))?$_POST["name"]:"") ."" . "|" . "".((isset($_POST["emailaddress"]))?$_POST["emailaddress"]:"") ."" . "|" . "".((isset($_POST["city"]))?$_POST["city"]:"") ."" . "|" . "".((isset($_POST["message"]))?$_POST["message"]:"") ."" . "|" . "".((isset($_POST["cpickedup"]))?$_POST["cpickedup"]:"") ."";
$WA_columnTypesStr = "',none,''|',none,''|',none,''|',none,''|',none,''";
$WA_fieldNames = explode("|", $WA_fieldNamesStr);
$WA_fieldValues = explode("|", $WA_fieldValuesStr);
$WA_columns = explode("|", $WA_columnTypesStr);
$WA_connectionDB = $database_DarkMoonDB;
mysql_select_db($WA_connectionDB, $WA_connection);
if (!session_id()) session_start();
$insertParamsObj = WA_AB_generateInsertParams($WA_fieldNames, $WA_columns, $WA_fieldValues, -1);
$WA_Sql = "INSERT INTO `" . $WA_table . "` (" . $insertParamsObj->WA_tableValues . ") VALUES (" . $insertParamsObj->WA_dbValues . ")";
$MM_editCmd = mysql_query($WA_Sql, $WA_connection) or die(mysql_error());
$_SESSION[$WA_sessionName] = mysql_insert_id();
if ($WA_redirectURL != "") {
if ($WA_keepQueryString && $WA_redirectURL != "" && isset($_SERVER["QUERY_STRING"]) && $_SERVER["QUERY_STRING"] !== "" && sizeof($_POST) > 0) {
$WA_redirectURL .= ((strpos($WA_redirectURL, '?') === false)?"?":"&").$_SERVER["QUERY_STRING"];
}
header("Location: ".$WA_redirectURL);
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">