Hola maestros:
Como puedo pasarle un parametro desde el include a un programa lo que intento hacer es lo siguiente:
Código PHP:
$nom_archivo="mi_archivo";
include('bajando.php?id='.$nom_archivo.'.txt');
el programa bajando.php es:
Código PHP:
<?php
$id = $_GET['id'];
$enlace = "DOWNLOADS/".$id;
header ("Content-Disposition: attachment; filename="."DOWNLOADS/".$id."\n\n");
header ("Content-Type: application/octet-stream");
header ("Content-Length: ".filesize($enlace));
readfile($enlace);
?>
pense que podia enviarselo como url pero me envia errores:
Warning: main(bajando.php?id=20040903.txt) [function.main]: failed to open stream: Invalid argument in c:\wamp\www\NAME\descargas.php on line 36
Warning: main() [function.include]: Failed opening 'bajando.php?id=20040903.txt' for inclusion (include_path='.;C:\php5\pear') in c:\wamp\www\NAME\descargas.php on line 36
no se si me haya explicado.