Perhaps someone can help me? I've tried a few suggestions from other posts but cannot resolve this warning:
Cannot add header information - headers already sent by (output started at includes/mysql_admin.inc:79)
This is the code:
function mysql_dump($result, $dba_name, $username, $password) {
$result = mysql_query("show variables") or trigger_error("Can't dump database or table.", FATAL);
while(TRUE) {
$row = mysql_fetch_row($result);
if ($row == FALSE) {
break;
} elseif ($row[0] == "basedir") {
$dir = $row[1]."bin".substr($row[1], -1);
}
}
header("Content-disposition: filename=$dba_name.sql");
header('Content-type: application/octetstream');
header('Pragma: no-cache');
header('Expires: 0');
passthru($dir."mysqldump --user=$username --password=$password $dba_name");
}
passthru... is line 79.
I've checked that there are no extra lines after '?>' in the icludes.
Any help is appreciated. BTW, the dump works fine.
Regards,
Martin Webster