Tema: Animacion
Ver Mensaje Individual
  #2 (permalink)  
Antiguo 14/01/2011, 09:00
Avatar de Panino5001
Panino5001
Me alejo de Omelas
 
Fecha de Ingreso: mayo-2004
Ubicación: -34.637167,-58.462984
Mensajes: 5.148
Antigüedad: 20 años
Puntos: 834
Respuesta: Animacion

Tu pregunta tiene que ver más con javascript, pero probá reemplazar tus archivos de esta manera:
Código PHP:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>Existencia de Productos</title>
        <link rel="stylesheet" type="text/css" href="css/estilos.css" />
            </head>
    <body>
    <?php
    
include("conex.php");
    
?>
    
    <div align="center"><strong> SELECCIONE LA BASE DE DATOS A RESPALDAR</strong> </div>
        <?php
           
           $result
=mysql_list_dbs();
           
        
?>
        <table width="400" border="0" align="center">     
        <tr>
        <form name='respaldo' method='post' action='respaldar_data.php' onsubmit="document.getElementById('loading').style.visibility='visible'" target="pp">
            <th width="150" scope="row" bordercolor="#F0F0F0" class="fondo"><label>Nombre del Respaldo:</label></th>
             <td colspan="6" align="center" bgcolor="#CCCCCC"><input name="backup" type="text" value="" size="25" maxlength="55" title="Nombre del Respaldo" class="inputboxInicio"  /><br/></td>
             <tr>
             <td colspan="3" align="center" bordercolor="#F0F0F0" class="fondo">
                 <label><strong> Base de Datos: </strong></label>
               <td width="139" bgcolor="#CCCCCC">
               <label> Datas: </label>
               </td>
             <td width="41">
           
              <select name = "datas" title="Datas">
                <?php 
                  
while ($resultado mysql_fetch_array($result))
                  {
                    
//$resultado[0] = 'Deportivos 2000';
                    
echo "<option value={$resultado['0']}>{$resultado['0']}</option>";
                  }
                  
mysql_free_result($result);
                
?>              
                </select>
                </td>
        </tr>
             <tr>
             <td colspan="7" bgcolor="#CCCCCC"><div align="right"> <img id="loading" style="visibility:hidden" src="http://www.labuenamesa.carrefour.es/img/loading.gif" /><input name="respaldar" type="submit" value="Respaldar" class="boton"  />
             
               
             </div></td>
             </tr>
          </form> 
         </tr>
        
             
        </table>
        
        
       </div>
<iframe style="position:absolute; top:-15000px; width:0; height:0" name="pp"></iframe>
</body>
</html>
Código PHP:
<?php


$backup 
$_POST['backup'];
$data $_POST['datas'];
$fecha date("Y-m-d");

system("mysqldump -h localhost -u root $data > ../respaldos/".$backup."_".$fecha.".sql ");



echo 
"
<script>
top.document.getElementById('loading').style.visibility='hidden';top.alert('respaldo completado');
</script>"
;
?>
Como verás, agregamos una imagen con id loading, agregamos un iframe de nombre pp y al tag form le agregamos un target pp para que el formulario se submita al iframe, y también le agregamos al tag form un evento onsubmit para que muestre la imagen loading cuando el form sea enviado. Finalmente cambiamos el javascript del segundo archivo para que actúe sobre la ventana principal, que es donde el iframe está incluído.