Open Password Protect Folder with Php

Discussion in 'PHP' started by h_j5005, Aug 25, 2008.

  1. #1
    Hello,
    I want to know is there any way to open e folder (password protect folder) with php script ? I want user cann't see password and username, php open folder and user can see folder's content.

    Example :
    Password Protect Folder >> domain.com/folder/
    Php file >> domain.net/file.php

    we put user and pass in php file (file.php) and when user click on file.php rediret to folder (not send user and pass in url) and can see folder content.
     
    h_j5005, Aug 25, 2008 IP
  2. The Universes

    The Universes Peon

    Messages:
    187
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    You cant password protect a folder using php exactly like that. However, you can have a php script that requires login and then shows a list of files. Those files can be protected via php.
     
    The Universes, Aug 26, 2008 IP
  3. h_j5005

    h_j5005 Peon

    Messages:
    55
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Tanx, but I think you don't understand my idea,
    I want to access to the folder in another site with php file in my site , password of that directory in my php and user only go file.php and then redirect to external domain .
     
    h_j5005, Aug 26, 2008 IP
  4. Dman91

    Dman91 Peon

    Messages:
    46
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Dman91, Aug 27, 2008 IP
  5. ghprod

    ghprod Active Member

    Messages:
    1,010
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    78
    #5
    or with .htaccess :)
     
    ghprod, Aug 28, 2008 IP