SitePoint Sponsor

User Tag List

Results 1 to 6 of 6

Threaded View

  1. #1
    Confirmed Halfwit
    Join Date
    Oct 1999
    Location
    Vancouver, BC, Canada
    Posts
    983
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm trying to output a .pdf file to screen.. and I have the following code that does not work:
    Code:
    <?php
    
    header( "Content-Type: application/pdf" );
    include('config.php');
    
    session_start();
    
    $dir = '/home3/gridops/reports/henri/TSR/test.pdf';
    readfile("$dir");
    >?
    It does work if I remove the "session_start()" part. However, if I do this then I won't be able to set the $dir variable with my session values..

    Anyone have any idea's? Is there a different way to output a .pdf file to screen besides linking to it directly? (I don't want the user to see where the file is located, so I am throwing a bunch of variables into the session and then calling the page that has this script.)

    Thanks,
    Henri Straforelli
    Last edited by hstraf; May 10, 2001 at 14:48.
    - A simple online WYSIWYG editor for HTML code snippets.
    - Managed Web Hosting - $3.95/month (resellers welcome)
    - Why pay more? $8.95 domains & $9.95 SSL certificates!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •