Ver Mensaje Individual
  #1 (permalink)  
Antiguo 02/04/2008, 14:02
gwana
 
Fecha de Ingreso: abril-2008
Mensajes: 8
Antigüedad: 16 años, 1 mes
Puntos: 0
Problema al enviar parámetros de ASP a PHP

PROBLEMA

Hola a todos tengo un problema que debe ser muy fácil de solucionar pero en realidad me tiene loco…Estoy bajando forzadamente un archivo pdf desde mi web con una página asp que envía por parámetro lo siguiente… (Este es el link para bajar el archivo pdf que esta en asp)

<a href="bajando.php?AuxPath=<%=TmpPath%>&Id=<%=TmpId %>">Bajar Archivo</a>

la página que debe recibir el parámetro esta en PHP es así

<?php

$enlace = $AuxPath.$Id;
header ("Content-Disposition: attachment; filename=".$Id."\n\n");
header ("Content-Type: application/octet-stream");
header ("Content-Length: ".filesize($enlace));
readfile($enlace);
?>
Esto me arroja un error ya que los parámetros no se traspasan a las variables…

Probé lo siguiente…para capturar los parámetros y saber si estaban llegando

$AuxPath = "<script language='javascript' type='text/javascript'>document.write(location.search.substri ng(9,146));</script>";
$Id = "<script language='javascript' type='text/javascript'>document.write(location.search.substri ng(150,location.search.length));</script>";

$enlace = $AuxPath.$Id;
echo $enlace;

Y COMO RESULTADO EN $enlase LOS PARAMETROS LLEGAN BIEN… PERO, AL AGREGAR AL CODIGO ESTO…

header ("Content-Disposition: attachment; filename=".$Id."\n\n");
header ("Content-Type: application/octet-stream");
header ("Content-Length: ".filesize($enlace));
readfile($enlace);

YA NO FUNCIONA

ME MUESTRA (EN EL PANEL PARA BAJAR) COMO NOMBRE DE ARCHIVO LO SIGUIENTE

<script language='javascript' type='text/javascript'>document.write(location.search.substri ng(9,146));</script>

Y CREO ME DEBERIA MOSTRAR EL CONTENIDO DEL LA VARIABLE $Id OSEA archivo.pdf

Alguien me podría decir que estoy haciendo mal o si lo mismo se puede hacer solo en asp…

Da ante mano gracias…