Results 1 to 3 of 3

Thread: Password Protect a file/folder

  1. #1
    Junior Registered
    Join Date
    Feb 2011
    Posts
    1

    Password Protect a file/folder

    I'm new to this forum and to PHP, so I hope I am posting this in the right area.

    I have this PHP login script where the user logs in and is able to view protected pages. When I create a separate folder at mydomain.net/videos that I want to password protect so that only a registered user who are logged in can access the video content within that folder. But I know you could just go directly to mydomain.net/videos and go around the login script and access the files without being logged in. Suggestion or help is much appreciated

    The script that I am using is from http://php-login-script.com

  2. #2
    Administrator Chris's Avatar
    Join Date
    Feb 2003
    Location
    East Lansing, MI USA
    Posts
    7,055
    Turn off directly indexes in Apache, or put a blank index.html file in the folder and no one will be able to go around your script to see a filename.

    The easiest way to do password protection will be protecting the folder with .htpasswd not with a php script, as that will be on every file in the folder.

    Unable to do that, you will need to pipe the content through a PHP script if you're relying on PHP for authentication. And... ideally... store the content below your web root so it isn't publicly accessible directly.

    I've piped images through a PHP script, not videos, but it'd be the same thing, you have PHP output the right mime type header, and then just load and ouput the video.
    Chris Beasley - My Guide to Building a Successful Website[size=1]
    Content Sites: ABCDFGHIJKLMNOP|Forums: ABCD EF|Ecommerce: Swords Knives

  3. #3
    Junior Registered
    Join Date
    Apr 2011
    Posts
    1
    Hi everyone need help i am using Sitebuilder through Fast Hosts and am setting up the pages i need to password protect the pages with differet access to differet pages how can i do that

Similar Threads

  1. vbulletin password reset
    By Chris in forum Community Management
    Replies: 3
    Last Post: 08-10-2009, 03:31 AM
  2. ASP, How can we programmatically verify whether the UserName and Password is Correct?
    By thomaskelly in forum Website Programming & Databases
    Replies: 1
    Last Post: 08-11-2008, 08:44 PM
  3. Password Protected Freewebs?
    By 007 in forum Website Programming & Databases
    Replies: 0
    Last Post: 03-30-2005, 07:41 AM
  4. password protection
    By albsure in forum Website Programming & Databases
    Replies: 12
    Last Post: 11-25-2003, 12:40 PM

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
  •