Web Analytics Made Easy -
StatCounter opening docs/pdfs - CodingForum

Announcement

Collapse
No announcement yet.

opening docs/pdfs

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • opening docs/pdfs

    Because I need to login protect some files, I'm using a PHP script to check login and then load the file.

    My question is how should I load the file?

    i.e. the user requested exam.pdf. Behind the scenes (with rewrites) I load view_file.php

    Should view_file using fopen or similar to load the file?

    It will mostly be pdf and word files but could be other so I'll probably have to check the extension.

  • #2
    The best option is to use readfile(). Check the manual page example for the headers you need to send.

    Comment

    Working...
    X
    😀
    🥰
    🤢
    😎
    😡
    👍
    👎