Ver Mensaje Individual
  #1 (permalink)  
Antiguo 19/05/2005, 09:22
Avatar de payo22
payo22
 
Fecha de Ingreso: noviembre-2002
Ubicación: México
Mensajes: 839
Antigüedad: 21 años, 5 meses
Puntos: 1
pasar parametros en un include

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.