#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2000
    Location
    Canada
    Posts
    16
    Rep Power
    0
    hi, does anyone knows how to write php in a .htaccess file? coz all i want to do is to have every member his own database with his own username and password, so that only hisself can access his own directory. but my membership creation is a web-based, so that i can't create the user's own password database by hand, so it must be done when a new user is created automatically.
    are there any ways to do that?

    Also, I tried to use php to call htpasswd but it seemed didn't work by the script: exec("htpasswd -b -c /usr/local/apache/passwd/perry perry perry");

    is that right? coz i did exactly the same in the shell and it worked in that way, only not in php script......please help....thanks a lot
  2. #2
  3. No Profile Picture
    freebsd
    Guest
    Devshed Newbie (0 - 499 posts)
    >>all i want to do is to have every member his own database with his own username and password

    Do this during the registration process and create appropriate .htaccess in user dir.

    >>Also, I tried to use php to call htpasswd but it seemed didn't work by the script

    Make sure "/path/to" htpasswd is in your path. So you should use /full/path/to/htpasswd" instead.
    Encrypting password is not too difficult to write, you don't need to use "/usr/local/apache/bin/htpasswd" at all. Check here -> http://www.devshed.com/Talk/Forums/F...ML/000264.html to find out the Perl way to encrypt password, then do some search and convert it to PHP.

Similar Threads

  1. Replies: 8
    Last Post: February 6th, 2004, 02:41 PM
  2. PHP .htaccess -please do not move need PHP info
    By DatNigz2002 in forum PHP Development
    Replies: 1
    Last Post: February 4th, 2004, 02:26 PM
  3. Make PHP bypass .htaccess
    By DatNigz2002 in forum PHP Development
    Replies: 2
    Last Post: February 4th, 2004, 12:27 PM
  4. .htaccess + mod_auth_mysql + php + custom login page
    By Seather in forum PHP Development
    Replies: 0
    Last Post: February 2nd, 2004, 09:15 PM
  5. .htaccess redirection with PHP variable
    By Avantasia in forum PHP Development
    Replies: 4
    Last Post: January 29th, 2004, 03:21 PM

IMN logo majestic logo threadwatch logo seochat tools logo