I am trying to use header(sprintf("Location: %s", $updateGoTo)); but I keep getting Warning: Cannot modify header information - headers already sent by (output started at /pfi_site/pfiac/specials.php:62). The only other place in my page that I use header is on line 3: header ("Cache-control: private" );
Can anyone find what is about to drive me crazy???
Code: Select all
<?php
session_start();
header ("Cache-control: private" ); //IE 6 Fix
?>
<?php require_once('../../Connections/connPFI.php'); ?>
<?php
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
$theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $theValue;
switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
mysql_select_db($database_connPFI, $connPFI);
$query_catdrilldown = "SELECT * FROM catdrilldown ORDER BY Title ASC";
$catdrilldown = mysql_query($query_catdrilldown, $connPFI) or die(mysql_error());
$row_catdrilldown = mysql_fetch_assoc($catdrilldown);
$totalRows_catdrilldown = mysql_num_rows($catdrilldown);
if ($HTTP_GET_VARS['CatID'] != ''){
$colname_specials = "1"; // default value when CatID is blank on first entry
if (isset($HTTP_GET_VARS['CatID'])) {
$colname_specials = (get_magic_quotes_gpc()) ? $HTTP_GET_VARS['CatID'] : addslashes($HTTP_GET_VARS['CatID']);
}
} else {
$colname_specials = "999999";
}
if ($colname_specials == "1") { // determine sort order by Home Page or not
$sort = "HomeSort"; // HomeSort when CatID is blank on first entry
} elseif ($colname_specials == "999999") {
$sort = "HomeSort"; // when Home Page is selected
} else {
$sort = "Sort"; // selection is not Home Page but has a CatID
}
mysql_select_db($database_connPFI, $connPFI);
$query_specials = sprintf("SELECT * FROM specials WHERE CatLink = '%s' AND IsActive = '1' and Expire > NOW() ORDER BY $sort ASC", $colname_specials);
$specials = mysql_query($query_specials, $connPFI) or die(mysql_error());
$row_specials = mysql_fetch_assoc($specials);
$totalRows_specials = mysql_num_rows($specials);
$colname_catdrilldown_label = "999999999";
if (isset($HTTP_GET_VARS['CatID'])) {
$colname_catdrilldown_label = (get_magic_quotes_gpc()) ? $HTTP_GET_VARS['CatID'] : addslashes($HTTP_GET_VARS['CatID']);
}
mysql_select_db($database_connPFI, $connPFI);
$query_catdrilldown_label = sprintf("SELECT Title FROM catdrilldown WHERE CatID = %s", $colname_catdrilldown_label);
$catdrilldown_label = mysql_query($query_catdrilldown_label, $connPFI) or die(mysql_error());
$row_catdrilldown_label = mysql_fetch_assoc($catdrilldown_label);
$totalRows_catdrilldown_label = mysql_num_rows($catdrilldown_label);
$i = 1; //initialize counter
$MM_paramName = "";
// *** Go To Record and Move To Record: create strings for maintaining URL and Form parameters
// create the list of parameters which should not be maintained
$MM_removeList = "&index=";
if ($MM_paramName != "") $MM_removeList .= "&".strtolower($MM_paramName)."=";
$MM_keepURL="";
$MM_keepForm="";
$MM_keepBoth="";
$MM_keepNone="";
// add the URL parameters to the MM_keepURL string
reset ($HTTP_GET_VARS);
while (list ($key, $val) = each ($HTTP_GET_VARS)) {
$nextItem = "&".strtolower($key)."=";
if (!stristr($MM_removeList, $nextItem)) {
$MM_keepURL .= "&".$key."=".urlencode($val);
}
}
// add the URL parameters to the MM_keepURL string
if(isset($HTTP_POST_VARS)){
reset ($HTTP_POST_VARS);
while (list ($key, $val) = each ($HTTP_POST_VARS)) {
$nextItem = "&".strtolower($key)."=";
if (!stristr($MM_removeList, $nextItem)) {
$MM_keepForm .= "&".$key."=".urlencode($val);
}
}
}
// create the Form + URL string and remove the initial '&' from each of the strings
$MM_keepBoth = $MM_keepURL."&".$MM_keepForm;
if (strlen($MM_keepBoth) > 0) $MM_keepBoth = substr($MM_keepBoth, 1);
if (strlen($MM_keepURL) > 0) $MM_keepURL = substr($MM_keepURL, 1);
if (strlen($MM_keepForm) > 0) $MM_keepForm = substr($MM_keepForm, 1);
?>
<?php echo "<?xml version="1.0" encoding="iso-8859-1"?".">"; ?>