Cannot modify header information
Hi
After an update to a record (code attached). I get a message saying:
Warning: Cannot modify header information - headers already sent by (output started at /Users/ray/Documents/Websites/administration/clientEdit.php:1) in /Users/ray/Documents/Websites/administration/webassist/mysqli/queryobj.php on line 32
This is the redirect function:
public function redirect($url) {
if ($url) header("location: " . $url);
}
This is the update code
$ClientEdit = new WA_MySQLi_RS("ClientEdit",$AdminConnect,1);
$ClientEdit->setQuery("SELECT * FROM Clients WHERE clientID = ?");
$ClientEdit->bindParam("i", "".(isset($_GET['clientID'])?$_GET['clientID']:"") ."", "-1"); //colname
$ClientEdit->execute();
?>
<?php
if ($_SERVER["REQUEST_METHOD"] == "POST") {
$UpdateQuery = new WA_MySQLi_Query($AdminConnect);
$UpdateQuery->Action = "update";
$UpdateQuery->Table = "Clients";
$UpdateQuery->bindColumn("clientName", "s", "".((isset($_POST["clientName"]))?$_POST["clientName"]:"") ."", "WA_DEFAULT");
$UpdateQuery->addFilter("clientID", "=", "i", "".($_GET['clientID']) ."");
$UpdateQuery->execute();
$UpdateGoTo = "/default.php";
if (function_exists("rel2abs")) $UpdateGoTo = $UpdateGoTo?rel2abs($UpdateGoTo,dirname(__FILE__)):"";
$UpdateQuery->redirect($UpdateGoTo);
}
?>