Hi
I've a php script for making a mysql db backup, I can browse a folder where to save the backup (it works), I want to change the code for saving the backup on a webserver folder example:
c:\backup
This is my code:
Any Ideas?
Thanks!!!
I've a php script for making a mysql db backup, I can browse a folder where to save the backup (it works), I want to change the code for saving the backup on a webserver folder example:
c:\backup
This is my code:
Code:
<?php
//Current Date
$date_month = date('m');
$date_year = date('Y');
$date_day = date('d');
$Date = "$date_year-$date_month-$date_day";
//File Name
$filename = "mydb_$Date.sql";
//My DB
$user = "root";
$passwd = "xpass";
$db = "users";
header("Pragma: no-cache");
header("Expires: 0");
header("Content-Transfer-Encoding: binary");
header("Content-type: application/force-download");
header("Content-Disposition: attachment; filename=$filename");
//Make the backup
$execute = "c:\wamp\bin\mysql\mysql5.0.51a\bin\mysqldump.exe -u $user --password=$passwd --opt $db";
system($execute, $result);
if ($result) { echo "<H1>Error on: $execute</H1>\n"; }
?>
Any Ideas?
Thanks!!!