-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdump.php
More file actions
28 lines (20 loc) · 755 Bytes
/
dump.php
File metadata and controls
28 lines (20 loc) · 755 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php
include 'sql.php';
$db = $_GET['db'];
include 'Mysqldump/Mysqldump.php';
$dump = new Ifsnop\Mysqldump\Mysqldump('mysql:host=localhost;dbname=' . $db, $user, $password);
$dump->start('output/ezadmin-' . $db . '-dump.sql');
$file = 'output/ezadmin-' . $db . '-dump.sql';
if (file_exists($file)) {
header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename="'.basename($file).'"');
header('Expires: 0');
header('Cache-Control: must-revalidate');
header('Pragma: public');
header('Content-Length: ' . filesize($file));
readfile($file);
exit;
}
header('Location: database.php?db=' . $db);
?>