Results 1 to 5 of 5

Thread: Include and protected folders.

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2002
    Location
    Allen, Texas
    Posts
    125

    Include and protected folders.

    I have a page which I am using the include function.

    I want to point that include to a password protected folder.

    If I try to view the folder directly by typing the link. It pops up with the password box.

    If I do the include, it doenst work and lets me view the file.

    How can I get the include to view the protected folder and still ask for a username and password?

  2. #2
    PowerPoster
    Join Date
    Sep 2003
    Location
    Edmonton, AB, Canada
    Posts
    2,629
    I don't think that's possible with PHP, although I could be wrong. When PHP is including the file, the HTACCESS files that protect the directory or file do not effect it. Again, I could be wrong, but I'm pretty sure that's how it is. You should just build a login and hide the files or something; there's lots to do.
    Like Archer? Check out some Sterling Archer quotes.

  3. #3
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    I would also think that PHP doesn't have this functionality. I'm sure PHP assumes that if the script exists on the server, then it should have access to those files.

    That's comepletely different than a random user navigating to the folder. By putting their script there or creating it, you're giving permission to access those files.

    If you want to keep people from viewing portions of your script that include these files, like kows said, you'll probably need to build your own log in scripts, which isn't hard at all.
    My evil laugh has a squeak in it.

    kristopherwilson.com

  4. #4
    Lively Member
    Join Date
    Sep 2002
    Posts
    100
    Can you demonstrate quickly how you passworded the folder? or is this for a non-windows box?

    Thanks,
    Mitchel

  5. #5
    Stuck in the 80s The Hobo's Avatar
    Join Date
    Jul 2001
    Location
    Michigan
    Posts
    7,256
    The .htaccess file can be used to password protect directories on *nix boxes, but not Windows.
    My evil laugh has a squeak in it.

    kristopherwilson.com

Posting Permissions

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



Click Here to Expand Forum to Full Width