David,
I'm completely stumped. I've looked at the code for
"update_grp.inc.php" and I can see no place that the header
has been
sent before. Here is the complete code for that page:
> <?php
> if (!function_exists("GetSQLValueString")) {
> function GetSQLValueString($theValue, $theType,
$theDefinedValue = "",
> $theNotDefinedValue = "")
> {
> $theValue = get_magic_quotes_gpc() ?
stripslashes($theValue) :
> $theValue;
>
> $theValue = function_exists("mysql_real_escape_string")
?
> mysql_real_escape_string($theValue) :
mysql_escape_string($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;
> }
> }
>
> $editFormAction = $_SERVER['PHP_SELF'];
> if (isset($_SERVER['QUERY_STRING'])) {
> $editFormAction .= "?" .
htmlentities($_SERVER['QUERY_STRING']);
> }
> if ((isset($_POST["MM_update"])) &&
($_POST["MM_update"] == "editGrp")) {
> $updateSQL = sprintf("UPDATE grp SET grp_name=%s WHERE
grp_id=%s",
> GetSQLValueString($_POST['grp_name'], "text"),
> GetSQLValueString($_POST['grp_id'], "int"));
>
> mysql_select_db($database_testadmin, $testadmin);
> $Result1 = mysql_query($updateSQL, $testadmin) or
die(mysql_error());
>
> if ($Result1) {
> header('Location:
http://' . $_SERVER['HTTP_HOST'] .
> dirname($_SERVER['PHP_SELF']) .
> '/admin.php?content=Products/seeSelections');
> exit;
> }
> }
>
> $colname_getGrp = "-1";
> if (isset($_GET['grp_id'])) {
> $colname_getGrp = $_GET['grp_id'];
> }
> mysql_select_db($database_testadmin, $testadmin);
> $query_getGrp = sprintf("SELECT * FROM grp WHERE grp_id
= %s",
> GetSQLValueString($colname_getGrp, "int"));
> $getGrp = mysql_query($query_getGrp, $testadmin) or
die(mysql_error());
> $row_getGrp = mysql_fetch_assoc($getGrp);
> $totalRows_getGrp = mysql_num_rows($getGrp);
>
> ?>
> <form action="<?php echo $editFormAction; ?>"
id="editGrp"
> name="editGrp" method="POST">
> <label for="grp_name">Name:</label>
> <br />
> <input name="grp_name" type="text" id="grp_name"
value="<?php echo
> htmlentities($row_getGrp['grp_name'], ENT_COMPAT,
'UTF-8'); ?>" />
> <br /><br />
> <input type="submit" name="submit" id="submit"
value="Update entry" />
> <input name="grp_id" type="hidden" id="grp_id"
value="<?php echo
> $row_getGrp['grp_id']; ?>" />
> <input type="hidden" name="MM_update" value="editGrp"
/>
> </form>
>
> <?php
> mysql_free_result($getGrp);
> ?>
As I mentioned before, line 44 starts with "header(Location:
...etc.)
Can you spot the problem? I checked the Page properties on
all pages
which are included and none have the BOM selected. Any other
thoughts?
Many thanks for your help.
Brett