Ver Mensaje Individual
  #5 (permalink)  
Antiguo 13/03/2003, 03:32
Manel
 
Fecha de Ingreso: febrero-2003
Mensajes: 4
Antigüedad: 21 años, 3 meses
Puntos: 0
He probado esto .... pero ...

He encontrado este codigo del colega Gusa que pretendia hacer lo mismo ( una copia desde web y dejar el fichero en el PC ).

Yo lo he probado pero me da un error que os pongo al final ... supongo que sera una tonteria ... pero no se ...

CODIGO :

<?



$filename="respaldo.sql";

header("Content-type: application/force-download");
header("Content-Disposition: attachment; filename=$filename");


$usuario="PEPE";
$passwd="PAPA";
$bd="MIBASE";

$executa = "/usr/local/mysql/bin/mysqldump -u$usuario -p$passwd $bd";
system($executa, $resultado);

if ($resultado)
{
echo "&lt;H1&gt;Error ejecutando comando: $executa&lt;/H1&gt;\n";
}

?>

RESULTADO :

Warning: Cannot add header information - headers already sent by (output started at /home/opipres/.public_html/id1/prueba_02.php:12) in /home/opipres/.public_html/id1/prueba_02.php on line 18

Warning: Cannot add header information - headers already sent by (output started at /home/opipres/.public_html/id1/prueba_02.php:12) in /home/opipres/.public_html/id1/prueba_02.php on line 19

<H1>Error ejecutando comando: /usr/local/mysql/bin/mysqldump -uPEPE -pPAPA MIBASE</H1>