|  | Posted by Martνn Marquιs on 06/21/66 11:13 
I'm having a bit of a problem understanding how the header() sends the HTTP headers.
 
 Here's what I want to do:
 
 1) Send a PDF file which will be printed in the client (the client will read
 it and print it if he wants to.
 2) Redirect to the main page of the aplication.
 
 Now, what happens to me is that, if I do (1) without (2), the PDF file is
 sent, but after printing and closing the PDF viewer, the browser stays in the
 old page, something I don't want.
 If I put (1) and (2) I don't get the PDF to print. I just redirects to the new
 page.
 
 Here is ths code (sorry about the comments on spanish :-) ):
 
 // Vamos a mandar el PDF
 header('Content-type: application/pdf');
 // El archivo se va a llamar libreDeuda.pdf
 header('Content-Disposition: attachment; filename="libreDeuda' .
 '.pdf"');
 // El PDF fuente va a ser $ftexName.
 readfile($fpdfName);
 
 // Redirijimos todo.
 header("Location: " . $_SERVER["PHP_SELF"] . "?" . session_name() .
 "=" . session_id());
 
 
 
 --
 11:47:49 up 12 days, 20:16,  1 user,  load average: 0.33, 0.30, 0.65
 -----------------------------------------------------------------
 MartΓn MarquΓ©s        | select 'mmarques' || '@' || 'unl.edu.ar'
 Centro de Telematica  |  DBA, Programador, Administrador
 Universidad Nacional
 del Litoral
 -----------------------------------------------------------------
  Navigation: [Reply to this message] |