I didn't want to cron the backup, just when the admin does :). Thanks anyway
and here is the solution i came up with: It's based on a prior answer
(thanks, Chris L.) and a pror discussion about forcing download in IE 5.5:


<?

$result=`mysqldump -hmy.host.com -u username -ppassword dbname`;

header("Content-Type: application/x-octet-stream");

header("Content-Description: MySQLDatabaseBackup File");

echo $result;

?>

This will work with IE 5.0, 5.5, NN6, NN4 (PC-Windows98/Me/2000) and NN4
(PC-RH Linux). But I don't think the platform or browser is guilty about
trying to open without asking first, just the applications it recognizes
(the web plugins installed), right?


----- Original Message -----
From: "Alex Sofronie" <[EMAIL PROTECTED]>
To: "PHP General" <[EMAIL PROTECTED]>; "Augusto Cesar Castoldi"
<[EMAIL PROTECTED]>
Sent: Monday, August 27, 2001 7:40 PM
Subject: Re: [PHP] MySQL Database backup



> > This script uses the MyPHPAdmin
> > (http://phpwizard.net/projects/phpMyAdmin/) dump, he
> > "fopen" the php script of MyAdmin (tbl_dump.php) and
> > write to a file the "result". This is the script
> >
> > ------------------------------------------------
> > function backup($url, $file)
> > {
> >   if (file_exists($file))
> >     unlink($file);
> >   if ($fd = fopen($url, "r"))
> >   {
> >     $aux = fread($fd, 10000000);
> >     fclose($fd);
> >     $fd = fopen($file, "aw" );
> >     fwrite($fd, $aux);
> >     fclose($fd);
> >   } else {
> >     $fd = fopen("logs.txt", "aw");
> >     fwrite($fd, "\n\nErro na URL: $url\n\n");
> >     fclose($fd);
> >   }
> > }
> > $file = "fiesc.sql";
> > $url =
> >
>
"http://$vendaval/libs/phpadmin2/tbl_dump.php?drop=1&showcolumns=yes&use_bac
> kquotes=1&what=data&server=1&lang=pt-br&db=fiesc";
> > backup($url, $file);
> > --------------------------------------------------
> >
> > see you,
> >
> > Augusto
> >
> >
> >
> >
> >  --- Alex Sofronie <[EMAIL PROTECTED]> escreveu: > I
> > tried find a solution to backup a mysql database
> > > using php but i didn't
> > > find anything but the binary file transfer solution
> > > (just open and binary
> > > copy all the files in my database directory). But
> > > this is not a desired
> > > solution because it involves some security holes
> > > that I cannot afford.
> > > Can anyone tell me where can i learn more about
> > > this? Or some simple :) and
> > > security holes free solution?
> > >
> > > Thanks all.
> > > Alex Sofronie
> > > [EMAIL PROTECTED]
> > >
> > >
> > > --
> > > PHP General Mailing List (http://www.php.net/)
> > > To unsubscribe, e-mail:
> > > [EMAIL PROTECTED]
> > > For additional commands, e-mail:
> > > [EMAIL PROTECTED]
> > > To contact the list administrators, e-mail:
> > > [EMAIL PROTECTED]
> > >
> >
> >
>
____________________________________________________________________________
> ___________________
> > Yahoo! GeoCities
> > Tenha seu lugar na Web. Construa hoje mesmo sua home page no Yahoo!
> GeoCities. É fácil e grátis!
> > http://br.geocities.yahoo.com/
> >
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to