if ($_POST['export_type'] == "sql") { header('Content-Type: text/sql'); header('Content-Disposition: attachment; filename="' . $export_filename . '.' . $_POST['export_type'] . '";'); if (isset($_POST['tables'])) { $tables = $_POST['tables']; } else { $tables = array(); $tables[0] = $_POST['single_table']; } $drop = isset($_POST['drop']); $structure = isset($_POST['structure']); $data = isset($_POST['data']); $transaction = isset($_POST['transaction']); $comments = isset($_POST['comments']); $db = new Database($_SESSION[COOKIENAME . 'currentDB']); echo $db->export_sql($tables, $drop, $structure, $data, $transaction, $comments); } else { if ($_POST['export_type'] == "csv") { header("Content-type: application/csv"); header('Content-Disposition: attachment; filename="' . $export_filename . '.' . $_POST['export_type'] . '";'); header("Pragma: no-cache"); header("Expires: 0"); if (isset($_POST['tables'])) { $tables = $_POST['tables']; } else { $tables = array(); $tables[0] = $_POST['single_table']; } $field_terminate = $_POST['export_csv_fieldsterminated']; $field_enclosed = $_POST['export_csv_fieldsenclosed']; $field_escaped = $_POST['export_csv_fieldsescaped'];