SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Evangelist elgumbo's Avatar
    Join Date
    Nov 2002
    Location
    North West, UK
    Posts
    545
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Protect files (txt / word etc) using sessions?

    Hi

    I'm using sessions to restrict access to a section of my site but I have a problem when it comes to restricting access to non php files on that section.

    Can anyone point me in the right direction on how I can stop people from accessing other files eg word or txt files?

    I can't just use a blanket .htaccess password as the users will have already logged in and I can't make them log-in again. But is there a way using PHP?

    Any help appreciated.

    Cheers

  2. #2
    Who turned the lights out !! Mandes's Avatar
    Join Date
    May 2005
    Location
    S.W. France
    Posts
    2,496
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Put your files in a seperate directory, then write a PHP script put in your webfile directory, pass the name of your file as a URL variable to the script and make the script access the file and output it to the browser.
    A Little Knowledge Is A Very Dangerous Thing.......
    That Makes Me A Lethal Weapon !!!!!!!!

    Contract PHP Programming

  3. #3
    SitePoint Evangelist elgumbo's Avatar
    Join Date
    Nov 2002
    Location
    North West, UK
    Posts
    545
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for the pointer, I'll give it a go


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
  •