Ver Mensaje Individual
  #1 (permalink)  
Antiguo 14/04/2005, 15:31
Avatar de chalchis
chalchis
 
Fecha de Ingreso: julio-2003
Mensajes: 1.773
Antigüedad: 20 años, 9 meses
Puntos: 21
Pregunta como refrescar despues de descargar un archivo

Hola amigos
tengo este codigo para descargar un archivo txt pero el problema
es como refrescar o direccionar a la misma pagina despues de descargar

$filename = "lista.txt";
// fix for IE catching or PHP bug issue
header("Pragma: public");
header("Expires: 0"); // set expiration time
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
// browser must download file from server instead of cache

// force download dialog
header("Content-Type: application/force-download");
header("Content-Type: application/octet-stream");
header("Content-Type: application/download");

// use the Content-Disposition header to supply a recommended filename and
// force the browser to display the save dialog.
header("Content-Disposition: attachment; filename=".basename($filename).";");

header("Content-Transfer-Encoding: binary");

$root_path = '/var/www/sitios/cuhm.mx/www/Export/';

$myfile = $root_path . $filename;

header("Content-Length: ".filesize($myfile));

readfile("$myfile");


//aqui actualizamos el campo de que ya fue exportado
$conexion =mysql_connect($host,$user_host,$pas_host) or die("Error no se pudo realizar la conexion al sevidor");
mysql_select_db($base_host,$conexion ) or die("No se pudo realizar conexion a la base de datos");

$result = mysql_query("SELECT * FROM $PRE_LICENCIATURAS", $conexion);
while ($row=mysql_fetch_row($result))
{
$clave=$row[0];
$sql="UPDATE $PRE_LICENCIATURAS SET EXPORTAR='v' WHERE ID='$clave' ";
$result2 = mysql_query($sql);
echo $clave."<br>";

}
mysql_close($conexion);

trate de poner este javascript y nada
no me direcciona

echo '
<script>
window.location="lista.php"
</script>';
__________________
gerardo